Skip to content

Commit aae7dce

Browse files
author
Till Brehm
committed
Make session ID regeneration configurable in security_settings.ini
1 parent 16ebfda commit aae7dce

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

interface/web/login/index.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,15 @@
216216
$user = $app->db->toLower($user);
217217

218218
if ($loginAs) $oldSession = $_SESSION['s'];
219-
// Session regenerate causes login problems on some systems, have to find a better way. see Issue #3827
220-
//if (!$loginAs) session_regenerate_id(true);
219+
220+
// Session regenerate causes login problems on some systems, see Issue #3827
221+
// Set session_regenerate_id to no in security settings, it you encounter
222+
// this problem.
223+
$app->uses('getconf');
224+
$security_config = $app->getconf->get_security_config('permissions');
225+
if(isset($security_config['session_regenerate_id']) && $security_config['session_regenerate_id'] == 'yes') {
226+
if (!$loginAs) session_regenerate_id(true);
227+
}
221228
$_SESSION = array();
222229
if ($loginAs) $_SESSION['s_old'] = $oldSession; // keep the way back!
223230
$_SESSION['s']['user'] = $user;

security/security_settings.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ admin_allow_software_packages=superadmin
1616
admin_allow_software_repo=superadmin
1717
remote_api_allowed=yes
1818
password_reset_allowed=yes
19+
session_regenerate_id=yes
1920

2021
[ids]
2122
ids_enabled=no

0 commit comments

Comments
 (0)