SessionTransport
SessionTransport
Interface for session token transport (HTTP layer).
interface SessionTransportResponsible for extracting and persisting session tokens via HTTP (cookies, headers, etc).
Methods
__construct
Construct the session.
public __construct(array $config): voidParameters
| Parameter | Type | Description |
|---|---|---|
$config | array |
extractToken
Extract a session token from the incoming request (e.g., from cookies or headers).
public extractToken(array $options): ?stringParameters
| Parameter | Type | Description |
|---|---|---|
$options | array |
extractRefreshToken
Extract the refresh token from the incoming request.
public extractRefreshToken(array $options): ?stringParameters
| Parameter | Type | Description |
|---|---|---|
$options | array |
persistToken
Persist a session token to the outgoing response (e.g., set cookie or header).
public persistToken(Response $response, ExpiringToken $token, array $options): voidParameters
| Parameter | Type | Description |
|---|---|---|
$response | Response | |
$token | ExpiringToken | |
$options | array |
persistRefreshToken
Persists the refresh token in the response.
public persistRefreshToken(Response $response, ExpiringToken $refreshToken, array $options): voidParameters
| Parameter | Type | Description |
|---|---|---|
$response | Response | |
$refreshToken | ExpiringToken | |
$options | array |
clearToken
Remove the session token from the client (e.g., clear cookie or header).
public clearToken(Response $response, array $options): voidParameters
| Parameter | Type | Description |
|---|---|---|
$response | Response | |
$options | array |
persistenceMode
Returns the persistence mode of this transport.
public persistenceMode(): TransportPersistenceIndicates whether the server controls token persistence automatically (ServerManaged, e.g. cookies) or whether the client is responsible for storing and resending tokens (ClientManaged, e.g. Authorization headers).
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:24 +0000