예제 #1
0
파일: Rememberer.php 프로젝트: flarum/core
 public function remember(ResponseInterface $response, AccessToken $token, $session = false)
 {
     $cookie = $this->createCookie()->withValue($token->id);
     if (!$session) {
         $lifetime = 60 * 60 * 24 * 14;
         $token->lifetime = $lifetime;
         $token->save();
         $cookie = $cookie->withMaxAge($lifetime);
     }
     return FigResponseCookies::set($response, $cookie);
 }
예제 #2
0
파일: Rememberer.php 프로젝트: Luceos/core
 public function remember(ResponseInterface $response, AccessToken $token)
 {
     $token->lifetime = 60 * 60 * 24 * 14;
     $token->save();
     return FigResponseCookies::set($response, $this->createCookie()->withValue($token->id)->withMaxAge(14 * 24 * 60 * 60));
 }