Gets the decoded remember me cookie from the request.

@param Request $req

@return RememberMeCookie|false
426867
private function getRememberMeCookie(Request $req)
    {
        $encoded = $req->cookies($this->rememberMeCookieName());
        if (!$encoded) {
            return false;
        }

        return RememberMeCookie::decode($encoded);
    }
1246997
public function verifyRequest(Request $request = null)
    {
        $request = $request ?: $this->request;
        $response = $request->request->get('g-recaptcha-response');
        $remoteip = $request->getClientIp();

        return $this->verify($response, $remoteip);
    }
413497
public function renewRememberMe() {
		
		// build the cookie name
		$cookieName = static::getRememberMeCookieName();
		
		// check if cookie exists
		if (!isset($_COOKIE[$cookieName])) {
			return FALSE;
		}
		
		// expire in 30 days
		$expire = time() + 60*60*24*30;
		
		// set cookie and return the result
		return setcookie($cookieName, $_COOKIE[$cookieName], $expire, '/');
		
	}
698825
protected function attemptLogin(Request $request)
    {
        return $this->guard()->attempt(
            $this->credentials($request), $request->filled('remember')
        );
    }
346286
public function negotiateResponseFormat(Request $req)
    {
        return $this->getFormatNegotiator()->getBestFormat($req->headers->get('Accept'), $this->formatPriorities);
    }
402303
public function logoutAction($req)
    {
        wei()->curUser->logout();

        $next = $req('next', $this->request->getReferer());

        return $this->response->redirect($next);
    }
949421
protected function unpackCookies(Request $request): Request
    {
        $cookies = $request->getCookieParams();

        foreach ($cookies as $name => $cookie) {
            if (!$this->isProtected($name)) {
                //Nothing to protect
                continue;
            }

            $cookies[$name] = $this->decodeCookie($cookie);
        }

        return $request->withCookieParams($cookies);
    }
1265906
final public function autoLogin(Request $request): ?TokenInterface
    {
        if (null === $cookie = $request->cookies->get($this->options['name'])) {
            return null;
        }

        if (null !== $this->logger) {
            $this->logger->debug('Remember-me cookie detected.');
        }

        $cookieParts = $this->decodeCookie($cookie);

        try {
            $user = $this->processAutoLoginCookie($cookieParts, $request);

            if (!$user instanceof UserInterface) {
                throw new \RuntimeException('processAutoLoginCookie() must return a UserInterface implementation.');
            }

            if (null !== $this->logger) {
                $this->logger->info('Remember-me cookie accepted.');
            }

            return new RememberMeToken($user, $this->providerKey, $this->secret);
        } catch (CookieTheftException $e) {
            $this->loginFail($request, $e);

            throw $e;
        } catch (UsernameNotFoundException $e) {
            if (null !== $this->logger) {
                $this->logger->info('User for remember-me cookie not found.', ['exception' => $e]);
            }

            $this->loginFail($request, $e);
        } catch (UnsupportedUserException $e) {
            if (null !== $this->logger) {
                $this->logger->warning('User class for remember-me cookie not supported.', ['exception' => $e]);
            }

            $this->loginFail($request, $e);
        } catch (AuthenticationException $e) {
            if (null !== $this->logger) {
                $this->logger->debug('Remember-Me authentication failed.', ['exception' => $e]);
            }

            $this->loginFail($request, $e);
        } catch (\Exception $e) {
            $this->loginFail($request, $e);

            throw $e;
        }

        return null;
    }
614961
public function refresh(Request $request)
    {
        try {
            $preAuthenticatedToken = $this->authenticator->authenticateToken(
                $this->authenticator->createToken($request, $this->providerKey),
                $this->provider,
                $this->providerKey
            );
        } catch (AuthenticationException $e) {
            return $this->failureHandler->onAuthenticationFailure($request, $e);
        }

        $refreshToken = $this->refreshTokenManager->get($preAuthenticatedToken->getCredentials());

        if (null === $refreshToken || !$refreshToken->isValid()) {
            return $this->failureHandler->onAuthenticationFailure($request, new AuthenticationException(
                    sprintf('Refresh token "%s" is invalid.', $refreshToken)
                )
            );
        }

        if ($this->ttlUpdate) {
            $expirationDate = new \DateTime();
            $expirationDate->modify(sprintf('+%d seconds', $this->ttl));
            $refreshToken->setValid($expirationDate);

            $this->refreshTokenManager->save($refreshToken);
        }

        $this->eventDispatcher->dispatch('gesdinet.refresh_token', new RefreshEvent($refreshToken, $preAuthenticatedToken));

        return $this->successHandler->onAuthenticationSuccess($request, $preAuthenticatedToken);
    }
1285873
private function parseToken(Request $request) : ?Token
    {
        $cookies    = $request->getCookieParams();
        $cookieName = $this->defaultCookie->getName();

        if (! isset($cookies[$cookieName])) {
            return null;
        }

        try {
            $token = $this->tokenParser->parse($cookies[$cookieName]);
        } catch (\InvalidArgumentException $invalidToken) {
            return null;
        }

        if (! $token->validate(new ValidationData())) {
            return null;
        }

        return $token;
    }
594920
private function loadPrincipalFromRememberMeCookie()
    {
        $hash = cookie('remember_me');
        if ($hash === null) {
            return;
        }

        try {
            list($id, $token) = explode('|', base64_decode($hash));
        }
        catch (Exception $e) {
            $this->deleteRememberMeCookie();
            return;
        }

        /** @var Model $user */
        $model = config('auth.model.class');
        $user  = call_user_func([$model, 'find'], $id);
        //$user = User::find($id);
        if ($user !== null && !empty($token) && $token === $user->getAttribute('remember_token')) {
            $this->setPrincipal($user->getId(), $user->getAttribute('name'), $user->getAttribute('role'));
        }
    }
416074
def get_decoded_jwt(request):
    
    jwt_cookie = request.COOKIES.get(jwt_cookie_name(), None)

    if not jwt_cookie:
        return None
    return jwt_decode_handler(jwt_cookie)
286348
public function getCookie($forceRefresh = false, $method = 'noCode')
    {
        $cacheKey = $this->getCacheKey();
        $cookie = $this->getCache()->fetch($cacheKey);

        if ($forceRefresh || empty($cookie)) {
            if (is_array($method)) {
                $cookie = call_user_func_array([$this, $method['method']], $method['param']);
            } else {
                $cookie = call_user_func([$this, $method]);
            }

            $this->setCookie($cookie);
        }

        return $cookie;
    }
954833
protected function decodeJwtTokenCookie($request)
    {
        return (array) JWT::decode(
            $this->encrypter->decrypt($request->cookie(Passport::cookie())),
            $this->encrypter->getKey(), ['HS256']
        );
    }
385357
public function applyCookie($req)
    {
        // fetch cookies
        $host = $req->getHeader('host');
        $path = $req->getUrlParam('path');
        $cookies = $this->fetchCookieToSend($host, $path);
        if ($this !== $req) {
            $cookies = array_merge($cookies, $req->fetchCookieToSend($host, $path));
        }
        // add to header
        $req->setHeader('cookie', null);
        foreach (array_chunk(array_values($cookies), 3) as $chunk) {
            $req->addHeader('cookie', implode('; ', $chunk));
        }
    }
989008
public function postLogin(Request $request)
    {
        $this->validate($request, [
            'user'      => 'required',
            'password'  => 'required',
        ]);

        $credentials = $request->only('user', 'password');

        if(auth()->guard('pulsar')->attempt($credentials, $request->has('remember')))
        {
            // check if user has access
            if(!auth()->guard('pulsar')->user()->access_010)
            {
                auth()->guard('pulsar')->logout();
                return redirect($this->loginPath)
                    ->withInput($request->only('user', 'remember'))
                    ->withErrors([
                        'loginErrors' => 3
                    ]);
            }

            // set user access control list
            session(['userAcl' => AclLibrary::getProfileAcl(auth()->guard('pulsar')->user()->profile_id_010)]);

            // check if user has permission to access
            if (!is_allowed('pulsar', 'access'))
            {
                auth()->guard('pulsar')->logout();
                return redirect($this->loginPath)
                    ->withInput($request->only('user', 'remember'))
                    ->withErrors([
                        'loginErrors' => 2
                    ]);
            }

            session(['packages' => Package::getRecords(['active_012' => true, 'orderBy' => ['column' => 'sorting_012', 'order' => 'desc']])]);
            session(['baseLang' => Lang::getBaseLang()]);

            return redirect()->intended($this->redirectTo);
        }

        return redirect($this->loginPath)
            ->withInput($request->only('user', 'remember'))
            ->withErrors([
                'loginErrors' => 1
            ]);
    }
8633
public function getSession(Request $request)
    {
        return tap($this->manager->driver(), function (Session $session) use ($request) {
            $session->setId($request->cookies->get($session->getName()));
        });
    }