I've searched around for a good answer to this question and found none. Basically I need my Magento users to be automatically logged out after 15 minutes or after they close the browser. Very simple issue but no definitive answer so far. I know when the lifetime is 0, cookie becomes a session cookie and will be expired after the browser is closed. When lifetime is >0 then cookie becomes a persistent cookie that will be expired after certain time. The problem is how to meet both conditions perfectly.
In Mage_Core_Model_Session_Abstract_Varien::start(), there is this code:
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()
);
...
call_user_func_array('session_set_cookie_params', $cookieParams);
...
session_start();
From this code, there is no way that I can modify to create 2 sessions (one with 0 lifetime, the other with 900 lifetime) per user access.
I also tried to modify the Mage_Core_Controller_Varien_Action::preDispatch() to instantiate 2 sessions per user access, but it doesn't work.
Is there a way to make Magento users log out after 15 minutes and after closing the browser?
session.gc_maxlifetime is 86400, session.gc_probability is 1, session.gc_divisor is 100.