Re: Overriding session length in existing session?
| From: | Scott Baker | Date: | Mon, 07 Mar 2011 16:58:23 +0000 |
| Subject: | Re: Overriding session length in existing session? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-311734@lists.php.net to get a copy of this message | ||
On 03/04/2011 11:48 AM, Marc Guay wrote:
> I think that my suggestion is still a valid solution, someone correct
> me if I'm wrong. Let's say your code went like this:
>
> session_start();
I did a ton of digging and came up with session_regenerate_id()
In my header.php I start the session as normal, and IF the user selects
"public terminal" I use the call set the session cookie length as 0 and
then regenerate the session cookie.
if ($public_term) {
session_set_cookie_params(0);
session_regenerate_id();
}
This way it defaults to a cookie of X days, but if it's a public
terminal it resets the cookie to expire at browser close.