For the header of every page of my login-ed section, I added the following codes to maintain the session:
session_set_cookie_params(1200, '/mysystem');
session_start();
My intention is, I set the session lifetime to 1200 seconds, with path /mysystem
via the function session_set_cookie_params(). The reason using this function is to separate the session cookie with other PHP scripts in same domain, e.g. http://www.example.com/another_system/
The problem is, the session expires when 1200 seconds is reached, no matter there are activities ( such as load another page under /mysystem
, or refresh the page .
Expected behavior: The session "countdown" resets when page activity is made when active session is valid.
What did I miss ?