Page 1 of 1

session_set_cookie_params() Expiry Time

Posted: Thu May 13, 2010 2:59 pm
by Plxply
Hello,

I currently have a very basic site which I have made containing a simple login system and registration system with the user information stored within a session once they've logged in. At the moment I have:

Code: Select all

session_set_cookie_params(strtotime('+1 week') - time());
At the top of every page, however I want to have an area where the user can specify how long they want to have the cookie stored on their system. Would I be able to change the cookie when the user logs in, and have it stay with that expiry time even though that command and session_start() is passed at the top of every page?

Re: session_set_cookie_params() Expiry Time

Posted: Thu May 13, 2010 5:53 pm
by Eran
You can recreate the cookie if you want to change the expiry date for an existing cookie.