private function getUserRememberMe(Request $req, Response $res)
    {
        // retrieve and verify the remember me cookie
        $cookie = $this->getRememberMeCookie($req);
        if (!$cookie) {
            return false;
        }

        $user = $cookie->verify($req, $this->auth);
        if (!$user) {
            $this->destroyRememberMeCookie($req, $res);

            return false;
        }

        $signedInUser = $this->auth->signInUser($user, 'remember_me');

        // generate a new remember me cookie for the next time, using
        // the same series
        $new = new RememberMeCookie($user->email(),
            $req->agent(),
            $cookie->getSeries());
        $this->sendRememberMeCookie($user, $new, $res);

        // mark this session as remembered (could be useful to know)
        $this->getSession()->set(self::SESSION_REMEMBERED_KEY, true);
        $req->setSession(self::SESSION_REMEMBERED_KEY, true);

        return $signedInUser;
    }
private function getUserRememberMe(Request $req, Response $res)
    {
        // retrieve and verify the remember me cookie
        $cookie = $this->getRememberMeCookie($req);
        if (!$cookie) {
            return false;
        }

        $user = $cookie->verify($req, $this->auth);
        if (!$user) {
            $this->destroyRememberMeCookie($req, $res);

            return false;
        }

        $signedInUser = $this->auth->signInUser($user, 'remember_me');

        // generate a new remember me cookie for the next time, using
        // the same series
        $new = new RememberMeCookie($user->email(),
            $req->agent(),
            $cookie->getSeries());
        $this->sendRememberMeCookie($user, $new, $res);

        // mark this session as remembered (could be useful to know)
        $this->getSession()->set(self::SESSION_REMEMBERED_KEY, true);
        $req->setSession(self::SESSION_REMEMBERED_KEY, true);

        return $signedInUser;
    }
private function getUserRememberMe ( Request $ req , Response $ res ) { // retrieve and verify the remember me cookie $ cookie = $ this -> getRememberMeCookie ( $ req ) ; if ( ! $ cookie ) { return false ; } $ user = $ cookie -> verify ( $ req , $ this -> auth ) ; if ( ! $ user ) { $ this -> destroyRememberMeCookie ( $ req , $ res ) ; return false ; } $ signedInUser = $ this -> auth -> signInUser ( $ user , 'remember_me' ) ; // generate a new remember me cookie for the next time, using // the same series $ new = new RememberMeCookie ( $ user -> email ( ) , $ req -> agent ( ) , $ cookie -> getSeries ( ) ) ; $ this -> sendRememberMeCookie ( $ user , $ new , $ res ) ; // mark this session as remembered (could be useful to know) $ this -> getSession ( ) -> set ( self :: SESSION_REMEMBERED_KEY , true ) ; $ req -> setSession ( self :: SESSION_REMEMBERED_KEY , true ) ; return $ signedInUser ; }
Tries to get an authenticated user via remember me.

@param Request  $req
@param Response $res

@return UserInterface|false
Tries to get an authenticated user via remember me .