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 expiration date.
Determine if a session driver has been configured.
Determine if the configured session driver is persistent.
Flush all static state.
Details
at line 36
__construct(SessionManager $manager, Factory $cache, ExceptionHandler $exceptionHandler)
Create a new session middleware.
at line 65
protected Response
handleRequestWhileBlocking(Request $request, Session $session, Closure $next)
Handle the given request within session state.
at line 90
protected Response
handleStatefulRequest(Request $request, Session $session, Closure $next)
Handle the given request within session state.
at line 136
protected Session
startSession(Request $request, Session $session)
Start the session for the given request.
at line 158
protected void
collectGarbage(Session $session)
Remove the garbage from the session if necessary.
at line 173
protected bool
configHitsLottery(array $config)
Determine if the configuration odds hit the lottery.
at line 181
protected void
storeCurrentUrl(Request $request, Session $session)
Store the current URL for the request if necessary.
at line 199
protected void
addCookieToResponse(Request $request, Response $response, Session $session)
Add the session cookie to the application response.
at line 224
protected array
resolveSessionCookieConfig(Request $request, array $config)
Get the session cookie configuration.
at line 252
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 260
protected void
saveSession(Request $request)
Save the session data to storage.
at line 270
protected int
getSessionLifetimeInSeconds()
Get the session lifetime in seconds.
at line 278
protected DateTimeInterface|int
getCookieExpirationDate()
Get the cookie expiration date.
at line 288
protected bool
sessionConfigured()
Determine if a session driver has been configured.
at line 296
protected bool
sessionIsPersistent(array|null $config = null)
Determine if the configured session driver is persistent.
at line 306
static void
flushState()
Flush all static state.