mirror of
https://github.com/unraid/webgui.git
synced 2026-01-13 21:20:01 -06:00
fix: login prompt when switching between servers
This commit is contained in:
@@ -24,7 +24,8 @@ setlocale(LC_ALL,'en_US.UTF-8');
|
||||
date_default_timezone_set(substr(readlink('/etc/localtime-copied-from'),20));
|
||||
ini_set("session.use_strict_mode", "1");
|
||||
session_name("unraid_".md5(strstr($_SERVER['HTTP_HOST'].':', ':', true)));
|
||||
session_set_cookie_params(0, '/; samesite=strict', null, array_key_exists('HTTPS', $_SERVER), true);
|
||||
$secure = array_key_exists('HTTPS', $_SERVER);
|
||||
session_set_cookie_params(0, '/; samesite='.$secure?'strict':'lax', null, $secure, true);
|
||||
if ($_SERVER['SCRIPT_NAME'] != '/login.php' && $_SERVER['SCRIPT_NAME'] != '/auth_request.php' && isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (!isset($var)) $var = parse_ini_file('state/var.ini');
|
||||
if (!isset($var['csrf_token'])) csrf_terminate("uninitialized");
|
||||
|
||||
Reference in New Issue
Block a user