I am using PHP to create a website and I use session for some parts such as keeping user logged in, etc. I set the session timeout to zero, so it expires when the browser is closed. My problem is that when the webpage is opened in the browser for some time and I don't use it, the session expires! I mean when I'm not using the browser (eg. I'm editing my code, or I'm gone for lunch, etc) and after some time I go back to it and refresh it, some times it needs me to login again.
This is the method I use to start the session:
function StartSecureSession(bool $RememberMe = false) {
session_set_cookie_params(($RememberMe? 7*24*60*60 : 0), "/");
session_start();
session_regenerate_id(true);
}
Could anyone tell me what's happening? Thank you
Note: I don't know if it matters, but I use Ubuntu 14.04 and chromium browser