1
0
Fork 0
mirror of synced 2024-06-01 18:39:57 +12:00

Merge pull request #1206 from lohanidamodar/fix-delete-session-removing-fallback-cookie

fixes deleteSession API removes browser's cookieFallback #1193
This commit is contained in:
Eldad A. Fux 2021-05-28 19:24:49 +03:00 committed by GitHub
commit 735cb90a44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1272,16 +1272,16 @@ App::delete('/v1/account/sessions/:sessionId')
->setParam('resource', '/user/'.$user->getId())
;
if (!Config::getParam('domainVerification')) {
$response
->addHeader('X-Fallback-Cookies', \json_encode([]))
;
}
$session->setAttribute('current', false);
if ($session->getAttribute('secret') == Auth::hash(Auth::$secret)) { // If current session delete the cookies too
$session->setAttribute('current', true);
if (!Config::getParam('domainVerification')) {
$response
->addHeader('X-Fallback-Cookies', \json_encode([]))
;
}
$response
->addCookie(Auth::$cookieName.'_legacy', '', \time() - 3600, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, null)