mirror of
https://github.com/unraid/webgui.git
synced 2026-05-02 15:59:35 -05:00
Purge expired sessions
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
<?php
|
||||
session_start();
|
||||
// purge sessions older than 2 days
|
||||
session_gc();
|
||||
session_destroy();
|
||||
|
||||
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Helpers.php";
|
||||
|
||||
@@ -70,6 +70,9 @@ if (!empty($_POST['username']) && !empty($_POST['password'])) {
|
||||
if ($output !== false) {
|
||||
$strCredentials = explode(":", $output);
|
||||
if (password_verify($_POST['password'], $strCredentials[1])) {
|
||||
// purge sessions older than 2 days
|
||||
session_gc();
|
||||
session_destroy();
|
||||
// Successful login, start session
|
||||
@unlink($failfile);
|
||||
session_start();
|
||||
|
||||
Reference in New Issue
Block a user