Skip to content

session.gc_maxlifetime should always be a relative value. #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

ianmaddox
Copy link

Without the addition of time(NULL), any value greater than 2678400 (30 days)
is treated as absolute. A 31 day gc_maxlifetime would result in empty sessions
because the memcached data is immediately timed out.

introduced in commit 39d0bee
fixes #142

Without the addition of time(NULL), any value greater than 2678400 (30 days)
is treated as absolute.  A 31 day gc_maxlifetime would result in empty sessions
because the memcached data is immediately timed out.

introduced in commit 39d0bee
fixes #142

See also http://www.php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime
@ianmaddox ianmaddox changed the title session.gc_maxlifetime should be a relative value. session.gc_maxlifetime should always be a relative value. Jul 3, 2014
@mkoppanen
Copy link
Member

Am I to understand that the functionality has been released in 2.2.0 and the latest stable?

@ianmaddox
Copy link
Author

Yes, I believe that is correct. I've actually run into this issue a few
times in the past several years, but always figured someone else would
handle it.
On Jul 15, 2014 6:22 PM, "Mikko Koppanen" notifications@github.com wrote:

Am I to understand that the functionality has been released in 2.2.0 and
the latest stable?


Reply to this email directly or view it on GitHub
#143 (comment)
.

@isotopp
Copy link

isotopp commented Mar 17, 2015

Why is this pull request abandoned? It should have been merged a year ago.

@sodabrew
Copy link
Contributor

One problem now is that some consumers of this library add their own timestamps to work around the removal of the time(NULL) in the php-memcached module.

Another problem is that the semantics of memcached itself specifically define 30-days as the transition point from relative time in seconds to absolute time in epoch seconds. The previous behavior was tripping up people who were providing absolute times.

A reasonable heuristic might be to add time(NULL) only if the timestamp is less than one billion. The epoch time for January 2017 starts around 1.483 billion.

@sodabrew
Copy link
Contributor

And as it turns out, almost exactly that idea was implemented in 27a22f3. Closing as resolved!

@sodabrew sodabrew closed this Jan 24, 2017
@sodabrew sodabrew added this to the 3.0.0 milestone Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Session values greater than 30 days expire immediately.
4 participants