StartSession
class StartSession
Properties
| static protected Closure> | $sessionCookieCallbacks | The callbacks used to configure the session cookie attributes. |
Methods
Create a new session middleware.
Handle the given request within session state.
Handle the given request within session state.
Determine if the configuration odds hit the lottery.
Store the current URL for the request if necessary.
Add the session cookie to the application response.
Register a callback to configure the session cookie attributes.
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.
Flush all static state.
Details
at line 35
__construct(SessionManager $manager, Factory $cache, ExceptionHandler $exceptionHandler)
Create a new session middleware.
at line 64
protected Response
handleRequestWhileBlocking(Request $request, Session $session, Closure $next)
Handle the given request within session state.
at line 89
protected Response
handleStatefulRequest(Request $request, Session $session, Closure $next)
Handle the given request within session state.
at line 135
protected Session
startSession(Request $request, Session $session)
Start the session for the given request.
at line 157
protected void
collectGarbage(Session $session)
Remove the garbage from the session if necessary.
at line 172
protected bool
configHitsLottery(array $config)
Determine if the configuration odds hit the lottery.
at line 180
protected void
storeCurrentUrl(Request $request, Session $session)
Store the current URL for the request if necessary.
at line 198
protected void
addCookieToResponse(Request $request, Response $response, Session $session)
Add the session cookie to the application response.
at line 223
protected array
resolveSessionCookieConfig(Request $request, array $config)
Get the session cookie configuration.
at line 251
static void
configureSessionCookieUsing(Closure $callback)
Register a callback to configure the session cookie attributes.
Boot-only. The callback persists in a static property for the worker lifetime and runs on every session cookie write across all coroutines. Callbacks run in registration order; later callbacks receive the values returned by earlier callbacks and may overwrite them.
at line 259
protected void
saveSession(Request $request)
Save the session data to storage.
at line 269
protected int
getSessionLifetimeInSeconds()
Get the session lifetime in seconds.
at line 277
protected DateTimeInterface|int
getCookieExpirationDate()
Get the cookie lifetime in seconds.
at line 289
protected bool
sessionConfigured()
Determine if a session driver has been configured.
at line 297
protected bool
sessionIsPersistent(array|null $config = null)
Determine if the configured session driver is persistent.
at line 307
static void
flushState()
Flush all static state.