1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-10-24 12:26:05 +02:00

Improve code style

This commit is contained in:
Marco
2017-02-25 17:58:29 +01:00
parent 94eeb9dbe0
commit 9c60acec0d
3 changed files with 12 additions and 2 deletions

View File

@@ -296,17 +296,23 @@ final class Auth extends UserManager {
}
// set the cookie with the selector and token
$cookie = new Cookie(self::COOKIE_NAME_REMEMBER);
$cookie->setValue($content);
$cookie->setExpiryTime($expires);
if (!empty($params['path'])) {
$cookie->setPath($params['path']);
}
if (!empty($params['domain'])) {
$cookie->setDomain($params['domain']);
}
$cookie->setHttpOnly($params['httponly']);
$cookie->setSecureOnly($params['secure']);
$result = $cookie->save();
if ($result === false) {