SessionCookie
final class SessionCookie (View source)
| internal |
Sends and expires the browser cookie that carries one session identifier.
Methods
Defines the host-only cookie identity and its sliding lifetime.
Sends the active identifier with a fresh persistent expiry.
Expires the transport cookie so the browser no longer presents the destroyed identity.
Returns the equivalent parameters required by PHP's native session runtime.
Fails before an identity-changing operation can diverge from browser state.
Details
__construct
__construct(string $name, int $lifetimeSeconds, SessionCookieSameSite $sameSite = SessionCookieSameSite::Lax, Closure|null $emitter = null, SessionCookieSecure $secure = SessionCookieSecure::Auto, ResolvedRequestContext|null $requestContext = null)
Defines the host-only cookie identity and its sliding lifetime.
send
void
send(string $sessionId)
Sends the active identifier with a fresh persistent expiry.
expire
void
expire()
Expires the transport cookie so the browser no longer presents the destroyed identity.
nativeParameters
array
nativeParameters()
Returns the equivalent parameters required by PHP's native session runtime.
assertCanChange
void
assertCanChange()
Fails before an identity-changing operation can diverge from browser state.