I have set the session.gc_maxlifetime
and session.cookie_lifetime
. As documented on the site, it gc_maxlifetime should set the maximum session time and setting cookie_lifetime to 0 should destroy the session. But its not working as expected.
I have following code in my php file :
ini_set('session.gc_maxlifetime', 3600); // For testing I keep it for 10 sec
ini_set('session.cookie_lifetime', 0);
session_start();
if ($_GET['set']) {
$_SESSION['test'] = 'test';
}
if ($_GET['delete']) {
session_destroy();
}
print_r($_SESSION);