09-14-2016, 11:19 AM
Maybe something else is different? I'm not sure where the double redirect or redirect after headers sent would come from.
if (isset($_SESSION['LAST_ACTIVITY']) && ((time()-$_SESSION['LAST_ACTIVITY']) > $site_settings->session_timeout) && $user->isLoggedIn()) {
session_unset(); // unset $_SESSION variable for the run-time
session_destroy(); // destroy session data in storage
Redirect::to($us_url_root);
}
$_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
Destroying the session of a non logged in user doesn't make sense, and that is the only additional check being done ($user->isLoggedIn(). The Redirect to $us_url_root simply reloads the page, and in effect generates a new "logged out session".
if (isset($_SESSION['LAST_ACTIVITY']) && ((time()-$_SESSION['LAST_ACTIVITY']) > $site_settings->session_timeout) && $user->isLoggedIn()) {
session_unset(); // unset $_SESSION variable for the run-time
session_destroy(); // destroy session data in storage
Redirect::to($us_url_root);
}
$_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
Destroying the session of a non logged in user doesn't make sense, and that is the only additional check being done ($user->isLoggedIn(). The Redirect to $us_url_root simply reloads the page, and in effect generates a new "logged out session".