|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #40275 FREQ: Ability to access sessions without increasing their lifetime
Submitted: 2007-01-29 17:49 UTC Modified: 2016-12-30 23:56 UTC
From: graced at monroe dot wednet dot edu Assigned:
Status: Open Package: Session related
PHP Version: 5.2.0 OS: Irrelevant
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-01-29 17:49 UTC] graced at monroe dot wednet dot edu
It's not readily apparent whether there is any way to do this with PHP's built-in session handler, so I figured I would write a request:

It would be nice to have a way to access a session (ala session_start()) in such a way where the lifetime of that session is not extended.

The intended application is for a PHP script that responds to polling (through Javascript) every ~5 minutes to report any new events.  For example, Javascript code might poll the server periodically to see if the user has any new messages on a forum.

Using session_start() in this situation is not neccessarily ideal as it would keep the user perpetually logged in until their webbrowser was closed.  The idea is that interactive actions (a user clicking on a link to another page on the site or submitting a form) should continue to increase the lifetime of a session, but noninteractive ones should not.  However, they should still be able to access (and potentially modify) session variables.

Additionally, with this feature an additional function (session_lifetime_remaining?) which returns the number of seconds until a session expires would be ideal -- allowing a user to be warned of impending logout due to inactivity.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-30 23:56 UTC]
-Package: Feature/Change Request +Package: Session related
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun May 16 06:01:23 2021 UTC