/** * Set the JWT cookie and Authorization header and redirect the User (for Laravel non-AJAX implementations). * * @param $jwt (JWT) * @return Response (Redirect) */ public function postLogin($jwt) { // Set a cookie with 'Http Only' set to false so that it can be read by JS $cookie = \Cookie::make('jwt', $jwt, 120, '/', env('SESSION_DOMAIN'), false, false); //return redirect('/')->header('Authorization', 'Bearer ' . $jwt)->withCookie($cookie); return redirect('/')->header('Authorization', 'Bearer ' . $jwt)->withCookie($cookie); }
public function logout() { Cookie::delete('remember'); Cookie::delete('generated'); Session::destroy(); // Session::unseted(['user_id', 'generated', 'username']); unset($this->user); }
static function deleteBasket() { Cookie::delete('basket'); }