Documentation

StartSession
in package

Table of Contents

$manager  : SessionManager
The session manager.
$sessionHandled  : bool
Indicates if the session was handled for the current request.
__construct()  : void
Create a new session middleware.
getSession()  : Session
Get the session implementation from the manager.
handle()  : mixed
Handle an incoming request.
terminate()  : void
Perform any final actions for the request lifecycle.
addCookieToResponse()  : void
Add the session cookie to the application response.
collectGarbage()  : void
Remove the garbage from the session if necessary.
configHitsLottery()  : bool
Determine if the configuration odds hit the lottery.
getCookieExpirationDate()  : DateTimeInterface
Get the cookie lifetime in seconds.
getSessionLifetimeInSeconds()  : int
Get the session lifetime in seconds.
sessionConfigured()  : bool
Determine if a session driver has been configured.
sessionIsPersistent()  : bool
Determine if the configured session driver is persistent.
startSession()  : Session
Start the session for the given request.
storeCurrentUrl()  : void
Store the current URL for the request if necessary.
usingCookieSessions()  : bool
Determine if the session is using cookie sessions.

Properties

$sessionHandled

Indicates if the session was handled for the current request.

protected bool $sessionHandled = false

Methods

handle()

Handle an incoming request.

public handle(Request $request, Closure $next) : mixed
Parameters
$request : Request
$next : Closure
Return values
mixed

addCookieToResponse()

Add the session cookie to the application response.

protected addCookieToResponse(Response $response, Session $session) : void
Parameters
$response : Response
$session : Session
Return values
void

collectGarbage()

Remove the garbage from the session if necessary.

protected collectGarbage(Session $session) : void
Parameters
$session : Session
Return values
void

configHitsLottery()

Determine if the configuration odds hit the lottery.

protected configHitsLottery(array<string|int, mixed> $config) : bool
Parameters
$config : array<string|int, mixed>
Return values
bool

getCookieExpirationDate()

Get the cookie lifetime in seconds.

protected getCookieExpirationDate() : DateTimeInterface
Return values
DateTimeInterface

getSessionLifetimeInSeconds()

Get the session lifetime in seconds.

protected getSessionLifetimeInSeconds() : int
Return values
int

sessionConfigured()

Determine if a session driver has been configured.

protected sessionConfigured() : bool
Return values
bool

sessionIsPersistent()

Determine if the configured session driver is persistent.

protected sessionIsPersistent([array<string|int, mixed>|null $config = null ]) : bool
Parameters
$config : array<string|int, mixed>|null = null
Return values
bool

storeCurrentUrl()

Store the current URL for the request if necessary.

protected storeCurrentUrl(Request $request, Session $session) : void
Parameters
$request : Request
$session : Session
Return values
void

usingCookieSessions()

Determine if the session is using cookie sessions.

protected usingCookieSessions() : bool
Return values
bool

Search results