class Illuminate / Session / Middleware / StartSession

StartSession

Properties

protected

$manager SessionManager

The session manager.

Default: null
protected

$cacheFactoryResolver callable|null

The callback that can resolve an instance of the cache factory.

Default: null

Methods

public

__construct ( SessionManager $manager , callable $cacheFactoryResolver ) : void

Create a new session middleware.

Parameters

public

handle ( $request , Closure $next ) : mixed

Handle an incoming request.

Parameters

protected

handleRequestWhileBlocking ( Request $request , $session , Closure $next ) : mixed

Handle the given request within session state.

Parameters

protected

handleStatefulRequest ( Request $request , $session , Closure $next ) : mixed

Handle the given request within session state.

Parameters

protected

startSession ( Request $request , $session ) : Session

Start the session for the given request.

Parameters

public

getSession ( Request $request ) : Session

Get the session implementation from the manager.

Parameters

protected

collectGarbage ( Session $session ) : void

Remove the garbage from the session if necessary.

Parameters

protected

configHitsLottery ( array $config ) : bool

Determine if the configuration odds hit the lottery.

Parameters

  • $config array
protected

storeCurrentUrl ( Request $request , $session ) : void

Store the current URL for the request if necessary.

Parameters

protected

addCookieToResponse ( Symfony\...\Response $response , Session $session ) : void

Add the session cookie to the application response.

Parameters

  • $response Symfony\...\Response
  • $session Session
protected

saveSession ( $request ) : void

Save the session data to storage.

Parameters

protected

getSessionLifetimeInSeconds ( ) : int

Get the session lifetime in seconds.

protected

getCookieExpirationDate ( ) : DateTimeInterface |int

Get the cookie lifetime in seconds.

protected

sessionConfigured ( ) : bool

Determine if a session driver has been configured.

protected

sessionIsPersistent ( array $config ) : bool

Determine if the configured session driver is persistent.

Parameters

  • $config array|null
protected

cache ( $driver ) : Illuminate\...\Store

Resolve the given cache driver.

Parameters

  • $driver string