Middleware
class Middleware implements HttpKernelInterface (View source)
Properties
protected HttpKernelInterface | $app | The wrapped kernel implementation. |
|
protected SessionManager | $manager | The session manager. |
|
protected Closure|null | $reject | The callback to determine to use session arrays. |
Methods
Create a new session middleware.
Handle the given request and get the response.
Check the request and reject callback for array sessions.
Start the session for the given request.
Get the full URL for the request.
Determine if the configuration odds hit the lottery.
Add the session cookie to the application response.
Get the session lifetime in seconds.
Get the cookie lifetime in seconds.
Determine if a session driver has been configured.
Determine if the configured session driver is persistent.
Get the session implementation from the manager.
Details
void
__construct(HttpKernelInterface $app, SessionManager $manager, Closure $reject = null)
Create a new session middleware.
Response
handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true)
Handle the given request and get the response.
void
checkRequestForArraySessions(Request $request)
Check the request and reject callback for array sessions.
protected SessionInterface
startSession(Request $request)
Start the session for the given request.
protected void
closeSession(SessionInterface $session)
Close the session handling for the request.
protected string
getUrl(Request $request)
Get the full URL for the request.
protected void
collectGarbage(SessionInterface $session)
Remove the garbage from the session if necessary.
protected bool
configHitsLottery(array $config)
Determine if the configuration odds hit the lottery.
protected void
addCookieToResponse(Response $response, SessionInterface $session)
Add the session cookie to the application response.
protected
getLifetimeSeconds()
Get the session lifetime in seconds.
protected int
getCookieLifetime()
Get the cookie lifetime in seconds.
protected bool
sessionConfigured()
Determine if a session driver has been configured.
protected bool
sessionIsPersistent(array $config = null)
Determine if the configured session driver is persistent.
SessionInterface
getSession(Request $request)
Get the session implementation from the manager.