Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In Drupal 7 (but not in Drupal 6), drupal_initialize_session() is responsible for setting the current timezone. It seemed a bit odd to me, but it does make sense that you'd want to set the page timezone as soon as possible in the request. Considering drupal_session_initialize() is the first time the user's data become available, that's the very first place where the timezone may be set.
For reference, this was added in Drupal 7 core in #348448-113: Always report E_STRICT errors and may be seen in the current DB session handler: http://api.drupal.org/drupal_session_initialize
Comment | File | Size | Author |
---|---|---|---|
#2 | memcache-session-timezone-1785744-2.patch | 607 bytes | markpavlitski |
memcache_session_timezone.patch | 384 bytes | quicksketch |
Comments
Comment #1
quicksketchThe demonstrable problem is easily seen by enabling the memcache session handler, then all dates on all nodes will appear to use the site-wide timezone instead of the one in the user profile. So basically if you use the memcache session handler all timezones are incorrect for users.
Comment #2
markpavlitski CreditAttribution: markpavlitski commentedCore session.inc sets the timezone in both drupal_session_initialize() and drupal_session_regenerate().
Comment #3
markpavlitski CreditAttribution: markpavlitski commentedComment #4
sd46 CreditAttribution: sd46 commentedPatch in #2 is ok, and should be applied to bring this into line with how the Drupal 7 session handler currently works.
Comment #5
Jeremy CreditAttribution: Jeremy commentedThanks! Patch committed:
http://drupalcode.org/project/memcache.git/commit/bcd9c75