@param Request $request
@param string $sessionId

@return RedirectResponse
338953
public function kickAction(Request $request, string $sessionId): RedirectResponse
    {
        // FIXME: can't destroy without delete all current cookie,
        // TODO: implement session delete
        $this->sessionStorage->getSaveHandler()->destroy($sessionId);
        $this->auditManager->kicking($sessionId);

        return RedirectResponse::create($request->headers->get('referer'));
    }
541720
public StartPullSessionResponse startPullSession(String sessionId) {
        StartPullSessionRequest request = new StartPullSessionRequest().withSessionId(sessionId);
        return startPullSession(request);
    }
583684
public function start(string $sessionID = null)
    {
        if($this->isStart)
        {
            throw new \RuntimeException('Session can not repeated start');
        }
        $this->handler = RequestContext::getServerBean($this->handlerClass);
        $this->isNewSession = null === $sessionID;
        if($this->isNewSession)
        {
            $this->id = $this->handler->createSessionID();
        }
        else
        {
            $this->id = $sessionID;
            $this->data = $this->handler->decode($this->handler->read($this->id));
        }
        $this->isStart = true;
    }
353467
public function redirectAction(Request $request, Error404 $error404)
    {
        $redirection = new ErrorRedirection();
        $redirection->setError($error404);

        $form = $this->getError404RedirectionForm($redirection);
        $form->handleRequest($request);

        if ($request->query->get('novalidate', false) === false) {
            if ($form->isValid()) {
                if ($redirection->getLink()->getLinkType() !== Link::TYPE_NONE) {
                    $error404->setRedirection($redirection);
                    $redirection->setError($error404);
                    $redirection->setUrl($error404->getUrl());

                    $em = $this->getDoctrine()->getManager();
                    $em->persist($redirection);
                    $em->flush();

                    $this->congrat($this->get('translator')->trans('victoire.404.redirection.success'));

                    return $this->returnAfterRemoval($error404);
                }

                $form->addError(new FormError($this->get('translator')->trans('victoire.404.form.error.blank')));
            }

            $this->warn($this->get('translator')->trans('victoire.404.form.error.unvalid'));

            return new Response($this->renderView('@VictoireSeo/Error404/_list.html.twig', [
                'form'     => $form->createView(),
                'error'    => $error404,
                'isOpened' => true,
            ]), 200, [
                'X-Inject-Alertify' => true,
            ]);
        }

        // rebuild form to avoid wrong form error
        $form = $this->getError404RedirectionForm($redirection);

        return new JsonResponse([
            'html' => $this->renderView('@VictoireSeo/Error404/_list.html.twig', [
                'form'     => $form->createView(),
                'error'    => $error404,
                'isOpened' => true,
            ]),
        ]);
    }
973398
public function write($sessionid, $sessiondata)
    {
        $wasWritten = !(file_put_contents("{$this->savePath}{$sessionid}.txt", $sessiondata) === false);

        if (!$wasWritten) {
            // maybe there's no folder on file system?

            if (!is_dir($this->savePath)) {
                Directory::mkdir($this->savePath, 0755);
                $wasWritten = !(file_put_contents("{$this->savePath}{$sessionid}.txt", $sessiondata) === false);
            }
        }

        return $wasWritten;
    }
155702
private function createRedirectResponse(Request $request)
    {
        $url = $this->loginUrl.'?'.http_build_query([
            'redirect_to' => $request->getUri(),
            'reauth'      => 0,
        ]);

        return RedirectResponse::create($url, 302);
    }
458486
public function updateSession($sessionId, $update)
  {
    return $this->put->path('/sessions/')->subpath($sessionId)->body($update);
  }
233339
public static function singleton ($sessionID = FALSE)
	{
		
		// If no instance is set
		
		if (self::$_instance === FALSE)
		{
			
			// Create an instance
			
			self::$_instance	= new static ($sessionID);
			
		}
		
		// Return instance
		
		return self::$_instance;
		
	}
478136
protected function doWrite($sessionId, $data)
    {
        $item = $this->getCacheItem($sessionId);
        $item->set($data)
            ->expiresAfter($this->ttl);

        return $this->cache->save($item);
    }
43928
public function successAction(Request $request)
    {
        $orderId = $request
            ->query
            ->get('id', false);

        $successRoute = $this
            ->redirectionRoutes
            ->getRedirectionRoute('success');

        $redirectUrl = $this
            ->urlGenerator
            ->generate(
                $successRoute->getRoute(),
                $successRoute->getRouteAttributes(
                    $orderId
                )
            );

        return new RedirectResponse($redirectUrl);
    }
578968
private function _getSession($sessionId)
    {
        if (is_null($this->_session)) {
            $this->_session = $this->_repository->find(array('sessionId' => $sessionId));
        }

        return $this->_session;
    }
492214
public function loginAction(Request $request)
    {
        $request->getSession()->set('LOGGED_VIA_CAS', true);
        $manager = $this->ssoFactory->getManager('cas_sso');

        return new RedirectResponse($manager->getServer()->getLoginUrl());
    }
115191
public function touch($sessionId, $ip) {
		$probability = (int)Configure::read('Captcha.cleanupProbability');
		$this->cleanup($probability);

		$captcha = $this->newEntity(
			[
				'session_id' => $sessionId,
				'ip' => $ip,
			]
		);
		if (!$this->save($captcha)) {
			throw new BadMethodCallException('Sth went wrong: ' . print_r($captcha->getErrors(), true));
		}

		return $captcha->id;
	}
1027806
public function redirectToServiceAction(Request $request, $service)
    {
        try {
            $authorizationUrl = $this->container->get('hwi_oauth.security.oauth_utils')->getAuthorizationUrl($request, $service);
        } catch (\RuntimeException $e) {
            throw new NotFoundHttpException($e->getMessage(), $e);
        }

        $session = $request->getSession();

        // Check for a return path and store it before redirect
        if (null !== $session) {
            // initialize the session for preventing SessionUnavailableException
            if (!$session->isStarted()) {
                $session->start();
            }

            foreach ($this->container->getParameter('hwi_oauth.firewall_names') as $providerKey) {
                $sessionKey = '_security.'.$providerKey.'.target_path';
                $sessionKeyFailure = '_security.'.$providerKey.'.failed_target_path';

                $param = $this->container->getParameter('hwi_oauth.target_path_parameter');
                if (!empty($param) && $targetUrl = $request->get($param)) {
                    $session->set($sessionKey, $targetUrl);
                }

                if ($this->container->getParameter('hwi_oauth.failed_use_referer') && !$session->has($sessionKeyFailure) && ($targetUrl = $request->headers->get('Referer')) && $targetUrl !== $authorizationUrl) {
                    $session->set($sessionKeyFailure, $targetUrl);
                }

                if ($this->container->getParameter('hwi_oauth.use_referer') && !$session->has($sessionKey) && ($targetUrl = $request->headers->get('Referer')) && $targetUrl !== $authorizationUrl) {
                    $session->set($sessionKey, $targetUrl);
                }
            }
        }

        return $this->redirect($authorizationUrl);
    }
1207213
protected function startSession(Request $request)
    {
        $session = parent::startSession($request);

        $locale = DashboardLanguageFacade::getDashboardLanguage();

        app()->setLocale($locale);

        Event::fire(new SessionStarted($session));

        return $session;
    }
1142185
protected function sendLoginResponse(Request $request)
    {
        $request->session()->regenerate();

        $this->clearLoginAttempts($request);

        return $this->authenticated($request, $this->guard()->user())
                ?: redirect()->intended($this->redirectPath());
    }
778884
public function redirect(Request $request)
    {
        $provider = $request->get('provider');

        if ($provider === null) {
            throw new HttpException(500, 'provider necessary');
        }

        return \Socialize::with($provider)->redirect();
    }