1
0
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:
Marco
2017-10-19 20:19:19 +02:00
parent d181219e40
commit ce8dbbc436

View File

@@ -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();
}
} }
/** /**