mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-02 22:27:30 +02:00
Delete 'remember me' cookies from previous major versions as well
This commit is contained in:
21
src/Auth.php
21
src/Auth.php
@@ -470,6 +470,27 @@ final class Auth extends UserManager {
|
|||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
throw new HeadersAlreadySentError();
|
throw new HeadersAlreadySentError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if we've been deleting the cookie above
|
||||||
|
if (!isset($selector) || !isset($token)) {
|
||||||
|
// attempt to delete a potential old cookie from versions v1.x.x to v6.x.x as well
|
||||||
|
|
||||||
|
$cookie = new Cookie('auth_remember');
|
||||||
|
|
||||||
|
if (!empty($params['path'])) {
|
||||||
|
$cookie->setPath($params['path']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($params['domain'])) {
|
||||||
|
$cookie->setDomain($params['domain']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$cookie->setHttpOnly($params['httponly']);
|
||||||
|
$cookie->setSecureOnly($params['secure']);
|
||||||
|
|
||||||
|
// delete the instance (requests a cookie to be written on the client)
|
||||||
|
$cookie->delete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user