Cartalyst\Sentinel\Sentinel::loginAndRemember PHP Method

loginAndRemember() public method

Persists a login for the given user, with the "remember" flag.
public loginAndRemember ( Cartalyst\Sentinel\Users\UserInterface $user ) : Cartalyst\Sentinel\Users\UserInterface | boolean
$user Cartalyst\Sentinel\Users\UserInterface
return Cartalyst\Sentinel\Users\UserInterface | boolean
    public function loginAndRemember(UserInterface $user)
    {
        return $this->login($user, true);
    }

Usage Example

Example #1
0
 public function postRegister(CredentialsRequest $request)
 {
     if ($user = $this->sentinel->registerAndActivate($this->getRequestData($request))) {
         $this->sentinel->loginAndRemember($user);
         $this->setResponseData($user->toArray());
     } else {
         $this->setErrorData("Can't create user");
     }
     return $this->responseJson();
 }
All Usage Examples Of Cartalyst\Sentinel\Sentinel::loginAndRemember