mirror of
https://github.com/flarum/core.git
synced 2025-07-30 05:00:56 +02:00
No need to set a remember cookie if only logging in for session
This commit is contained in:
@@ -24,7 +24,6 @@ class Rememberer
|
||||
protected $cookie;
|
||||
|
||||
/**
|
||||
* Rememberer constructor.
|
||||
* @param CookieFactory $cookie
|
||||
*/
|
||||
public function __construct(CookieFactory $cookie)
|
||||
@@ -32,18 +31,16 @@ class Rememberer
|
||||
$this->cookie = $cookie;
|
||||
}
|
||||
|
||||
public function remember(ResponseInterface $response, AccessToken $token, $session = false)
|
||||
public function remember(ResponseInterface $response, AccessToken $token)
|
||||
{
|
||||
$lifetime = null;
|
||||
|
||||
if (! $session) {
|
||||
$token->lifetime = $lifetime = 5 * 365 * 24 * 60 * 60; // 5 years
|
||||
$token->save();
|
||||
}
|
||||
$token->lifetime = 5 * 365 * 24 * 60 * 60; // 5 years
|
||||
$token->save();
|
||||
|
||||
return FigResponseCookies::set(
|
||||
$response,
|
||||
$this->cookie->make(self::COOKIE_NAME, $token->id, $lifetime)
|
||||
$this->cookie->make(self::COOKIE_NAME, $token->id, $token->lifetime)
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user