mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Update session regenerate
This commit is contained in:
@@ -44,12 +44,12 @@
|
||||
}
|
||||
|
||||
//regenerate sessions to avoid session id attacks such as session fixation
|
||||
if (array_key_exists('security',$_SESSION) && $_SESSION['security']['session_rotate']['boolean'] == "true") {
|
||||
if (isset($_SESSION['authorized']) && $_SESSION['authorized']) {
|
||||
$_SESSION['session']['last_activity'] = time();
|
||||
if (!isset($_SESSION['session']['created'])) {
|
||||
$_SESSION['session']['created'] = time();
|
||||
} else if (time() - $_SESSION['session']['created'] > 28800) {
|
||||
// session started more than 8 hours ago
|
||||
} elseif (time() - $_SESSION['session']['created'] > 28800) {
|
||||
//session started more than 8 hours ago
|
||||
session_regenerate_id(true); // rotate the session id
|
||||
$_SESSION['session']['created'] = time(); // update creation time
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user