1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-08-29 10:29:48 +02:00

Support empty path scope for cookies to restrict to current directory

This commit is contained in:
Marco
2017-10-20 08:47:56 +02:00
parent ecd8015acf
commit 2cf7b27ba3
2 changed files with 10 additions and 6 deletions

View File

@@ -453,9 +453,7 @@ final class Auth extends UserManager {
$cookie->setValue($content);
$cookie->setExpiryTime($expires);
if (!empty($params['path'])) {
$cookie->setPath($params['path']);
}
$cookie->setPath($params['path']);
$cookie->setDomain($params['domain']);
$cookie->setHttpOnly($params['httponly']);
@@ -545,9 +543,7 @@ final class Auth extends UserManager {
// cause the session cookie to be deleted
$cookie = new Cookie(\session_name());
if (!empty($params['path'])) {
$cookie->setPath($params['path']);
}
$cookie->setPath($params['path']);
$cookie->setDomain($params['domain']);
$cookie->setHttpOnly($params['httponly']);