1
0
mirror of git://f0xx.org/ac/ac-platform-php synced 2026-07-29 02:18:27 +03:00

fix(session): 24h cookie lifetime and account-security route

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Anton Afanasyeu
2026-07-11 14:48:27 +02:00
parent 698fbd7658
commit 08fb2db96e
2 changed files with 2 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ function platform_start_session(string $sessionName = 'ac_crash_sess', string $c
} }
session_name($sessionName); session_name($sessionName);
session_set_cookie_params([ session_set_cookie_params([
'lifetime' => 0, 'lifetime' => 86400,
'path' => $cookiePath, 'path' => $cookiePath,
'httponly' => true, 'httponly' => true,
'samesite' => 'Lax', 'samesite' => 'Lax',

View File

@@ -119,7 +119,7 @@ function resolve_console_route(string $uri): string {
if ($projectRoot !== '' && str_starts_with($uri, $projectRoot)) { if ($projectRoot !== '' && str_starts_with($uri, $projectRoot)) {
$suffix = substr($uri, strlen($projectRoot)) ?: '/'; $suffix = substr($uri, strlen($projectRoot)) ?: '/';
$candidate = rtrim(strtok($suffix, '?') ?: '/', '/') ?: '/'; $candidate = rtrim(strtok($suffix, '?') ?: '/', '/') ?: '/';
if (preg_match('#^/(login|logout|register|verify-email|two-factor(?:/approve)?|api/two-factor(?:/poll)?)(/|$)#', $candidate)) { if (preg_match('#^/(login|logout|register|verify-email|account-security|two-factor(?:/approve)?|api/two-factor(?:/poll)?)(/|$)#', $candidate)) {
return $candidate; return $candidate;
} }
} }