From:             [EMAIL PROTECTED]
Operating system: Linux (RH6)
PHP version:      4.0.4pl1
PHP Bug Type:     Feature/Change Request
Bug description:  Session lifetimes beyond browse on per session basis

Something that's been requested in the annoated manuals but I don't see an actual 
feature request.

The problem is that while there is a session.gc_maxlifetime option in the ini file for 
dealing with the lifetime of session data, there is no way to set this on a per 
session level.

Eg. I have a login class that uses sessions to maintain data. It works fine so long as 
I don't want my login sessions to outlast the browser. Once I decided I wanted that to 
at least be an option of my class (set through a method) I had to perform a 
work-around of the session.cookie_lifetime INI file settings (since the 
session_set_cookie_params() call doesn't seem to work properly, or at least the way I 
wanted it to). 

At any rate, I managed to get around this problem and everything was working fine, but 
every so often (seemingly without ryhme or reason) when I returned to my example page 
the login class would come to a screaming halt and die(). After debugging for quite 
some time, I determined that it was because although I had managed to extend the life 
of the session id (though another cookie of my own and some funky hand-waving logic) 
the session DATA had expired after 1440 seconds, or 24 minutes. I got this number from 
the INI file as it was the value set for session.gc_maxlifetime.

Unfortunately, there is no way to extend this lifetime value through PHP; only via the 
ini file. This is not a viable solution however, when you run multiple virtual hosts 
on your server with the same PHP (as I do) and some of them have different login 
requirements (some more secure than others; some want the login to expire with the 
browser, others want it to last a week, etc.)

So my feature request is for a session_set_data_lifetime() function (and probably a 
get() equivilant for completeness). I'd also like it if the 
session_set_cookie_params() function actually worked like I think it should (and not, 
as it says cryptically, 'only for the duration of the script')

Thank you.

Edit Bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to