I have this PHP code (PHP5):
if($autologin == "on")
session_set_cookie_params(60*60*24*365); // 365 days
else
session_set_cookie_params(0); // when browser closes
session_start();
In my php.ini file I have this line, which I guess will give me a 365
days timeout on my PHPSESSID server session:
session.cookie_lifetime = 31536000
My problem is, that whatever I do, the session is set to 365 days no
matter if I have "autologin" on or off. Autologin is a checkbox that
asks the user if he wants to login automatically every time he visits my
page.
If I set the session.cookie_lifetime to the default value of 0, the
session expires always when the browser closes.
What am I doing wrong?