Edit report at https://bugs.php.net/bug.php?id=11982&edit=1
ID: 11982
Comment by: yohgaki at ohgaki dot net
Reported by: arni at linux dot is
Summary: session_expires()
Status: Analyzed
Type: Feature/Change Request
Package: Session related
Operating System: Windows2000
PHP Version: 4.0.6
Assigned To: yohgaki
Block user comment: N
Private report: N
New Comment:
Basically, session expiration is depend on browser's cookie expiration.
Therefore, when session is expired, session cookie is gone.
We can implement this feature in session module via new session data structure.
If we do, there will be compatibility issues. For instance, PERL or other
languages have PHP session data parser to share session data with PHP. New data
structure will break them.
I usually do this in my PHP script. e.g.
$_SESSION['expire'] = time() + 7200; // somewhere
then
if ($_SESSION['expire'] < time()) ..do something.. // elsewhere
I'm not sure if we should do this in session module.
Previous Comments:
------------------------------------------------------------------------
[2001-07-09 11:47:08] arni at linux dot is
I have a feature request for the session module in php. This request should be
self-explaining. I would appreciate if a session_expires(int seconds) function
would be implemented. Defining when a session will expire in seconds.
This function should destroy the session if the session is expired. Also, let
the function return 1 if the session is expired, and 0 if it's not expired.
Then it could be used in cases like:
if(session_is_expired()) {
...expired...die
}
else {
...not expired, continue...
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=11982&edit=1