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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

The 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.

markpavlitski’s picture

Core session.inc sets the timezone in both drupal_session_initialize() and drupal_session_regenerate().

markpavlitski’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
sd46’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #2 is ok, and should be applied to bring this into line with how the Drupal 7 session handler currently works.

Jeremy’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.