Edit report at https://bugs.php.net/bug.php?id=11982&edit=1
ID: 11982 Updated by: yohg...@php.net Reported by: arni at linux dot is Summary: session_expires() -Status: Analyzed +Status: Wont fix 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: Since how expire session is application dependent, make this request as won't fix. Previous Comments: ------------------------------------------------------------------------ [2011-11-08 03:25:15] yohgaki at ohgaki dot net BTW, current session data structure has rather strange data structure to support register globals. We can introduce new and cleaner data structure that can easily fetch session data directly from session data. i.e. use plain serialize() for session data serialization. ------------------------------------------------------------------------ [2011-11-08 03:20:25] yohgaki at ohgaki dot net 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. ------------------------------------------------------------------------ [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