1
0
mirror of https://github.com/prasathmani/tinyfilemanager.git synced 2025-07-28 12:31:10 +02:00

Create a new session if permission denied on current one (#331)

In a multi-user configuration, the current session file can be unreadable
by the current user. This tries to create a new session in this case.
This commit is contained in:
Nicolas Peugnet
2020-05-24 05:21:44 +02:00
committed by GitHub
parent 5903849388
commit 8fb1816877

View File

@@ -203,7 +203,17 @@ if (defined('FM_EMBED')) {
session_cache_limiter('');
session_name(FM_SESSION_ID );
@session_start();
function session_error_handling_function($code, $msg, $file, $line) {
// Permission denied for default session, try to create a new one
if ($code == 2) {
session_abort();
session_id(session_create_id());
@session_start();
}
}
set_error_handler('session_error_handling_function');
session_start();
restore_error_handler();
}
if (empty($auth_users)) {