SessionBackend
Less than 1 minute
SessionBackend
Methods
__construct
Construct the session.
public __construct(array $config): voidParameters
| Parameter | Type | Description |
|---|---|---|
$config | array |
create
Creates a new session for the given identity with the provided data.
public create(string $identity, array $data): voidParameters
| Parameter | Type | Description |
|---|---|---|
$identity | string | |
$data | array |
load
Validates the given session token and optionally populates session data.
public load(string $token, ?array $sessionData): boolParameters
| Parameter | Type | Description |
|---|---|---|
$token | string | |
$sessionData | array |
getToken
Retrieve the current authentication token from the session backend.
public getToken(): ?stringgetIdentity
Retrieves the identity associated with the current session.
public getIdentity(): ?stringisEmpty
Determines if the session backend is empty.
public isEmpty(): boolhas
Checks if a key exists in session.
public has(string $key): boolParameters
| Parameter | Type | Description |
|---|---|---|
$key | string |
get
Gets a value from session.
public get(string $key): mixedParameters
| Parameter | Type | Description |
|---|---|---|
$key | string |
set
Sets a value in session.
public set(string $key, mixed $value): voidParameters
| Parameter | Type | Description |
|---|---|---|
$key | string | |
$value | mixed |
Unsets a value in session.
public (string $key): voidParameters
| Parameter | Type | Description |
|---|---|---|
$key | string |
clear
Clears data from session.
public clear(): voidread
Reads and returns the session data.
public read(): voidGenerated by Hazaar API Doc Generator on Sun, 01 Mar 2026 09:22:26 +0000