Minimal steps to reproduce:
1. Install Drupal core.
2. Go to admin/config/development/performance, turn on page caching and set the maximum expiration of cached pages to a nonzero number (e.g. a few minutes).
3. Log out and visit the home page using Safari (make sure to visit e.g. http://example.com rather than http://example.com/node).
4. Log in via the block on the left sidebar.
5. Click on the site logo which will take you back to e.g. http://example.com. Notice you will appear to be logged out.
If you refresh the page in your browser it will correctly show you as logged in again, though.
What's happening seems to be that Safari is having issues with the Cache-Control max-age setting combined with the Vary: Cookie setting and is serving pages from the browser cache when it shouldn't.
For more details and previous discussion, see: http://groups.drupal.org/node/191453
This is not reproducible with other browsers and is quite likely to be a Safari bug: https://bugs.webkit.org/show_bug.cgi?id=71509
However, it's possible Drupal is doing something wrong here, or at least there is something we could be doing in Drupal to work around it.... Anyone have any ideas?
Comments
Comment #1
damien tournoud commentedThis is fascinating. I could reproduce easily on Safari 6.0.2.
Re-reading the HTTP/1.1 specification, it doesn't seem that we are doing anything wrong here. I don't see a way of fixing that other then having either
max-age=0ormust-revalidate(which would be the same for this particular purpose).Comment #2
Andre-Ba hotfix for running sites would be something like this (found here):
Though I am not sure if those headers should be set on hook_init or only for hook_preprocess_page, the latter could not cover ajax calls if I understood the structure correctly.
Comment #3
Andre-Bthe solution mentioned in #2 does not work.
Comment #4
Andre-BI created a sandbox with a hotfix module that "fixes" this bug for safari users: https://drupal.org/sandbox/baumeierit/2207235
Comment #5
maximpodorov commentedI have exactly the same problem. Is it possible to solve it?
Comment #7
mglamanAccording to the latest WebKit release notes, WebKit will now respect Vary: Cookie https://webkit.org/blog/6640/release-notes-for-safari-technology-preview...
See the confirming tweet: https://twitter.com/anttikoivisto/status/745668331282309121
Comment #8
maximpodorov commentedThe outdated versions are still installed on Mac computers.
Comment #11
j.b commentedAnyone having the same issue on Drupal 8 ?
Comment #17
longwaveSafari 6 is EOL and the original bug is fixed: https://bugs.webkit.org/show_bug.cgi?id=71509
I am closing this as outdated as there is nothing to change in Drupal here.