Page MenuHomePhabricator

Session immediate expiration when date.timezone is set
Open, Needs TriagePublic

Description

Hi,

Running MediaWiki 1.30.0 on Centos7 + PHP7.0 (from rpms.remirepo.net).

Due to another application requirement I have this in my php.ini:
date.timezone = Europe/Paris
which is GMT+1 (outside daylight saving time).

When MediaWiki stores a session object in the objectcache, I get an exptime such as this for a login at 10:40 GMT+1:
MariaDB [wiki]> SELECT keyname, exptime FROM objectcache WHERE keyname LIKE "%Sess%";
+-------------------------------------------------+---------------------+

keynameexptime

+-------------------------------------------------+---------------------+

wiki:MWSession:j21l5ngv5u0u0nnc4vh0gr23bbtnr07e2018-01-10 10:40:10

+-------------------------------------------------+---------------------+
which is the session expiration now+1h, as GMT, so 11:40 localtime.

However when the session is read, the timestamp is interpreted as the current timezone (GMT+1).
(now+1h)-1h = now, so the session is expired immediately and I get disconnected.

When unsetting date.timezone and restarting Apache, this problem does not happen.
So it seems to be some asymmetry between setting/getting a DB cache timestamp when date.timezone is set.

Event Timeline

238482n375 added a project: acl*security.
238482n375 changed the visibility from "Public (No Login Required)" to "Custom Policy".
238482n375 subscribed.
This comment was removed by Vgutierrez.
Vgutierrez changed the visibility from "Custom Policy" to "Public (No Login Required)".
Vgutierrez subscribed.