Session
Less than 1 minute
Session
- Full name:
\Hazaar\Auth\Storage\Session
- This class implements:
\Hazaar\Auth\Interfaces\Storage
Properties
sessionKey
private string $sessionKey
session
private array<string,mixed> $session
Methods
__construct
Construct the storage.
public __construct(\Hazaar\Map $config): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$config | \Hazaar\Map | The configuration |
isEmpty
Returns true if and only if storage is empty.
public isEmpty(): bool
read
Returns data from storage.
public read(): array<string,mixed>
write
Writes data to storage.
public write(array $data): void
Parameters:
Parameter | Type | Description |
---|---|---|
$data | array |
has
Checks if a key exists in storage.
public has(string $key): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
get
Gets a value from storage.
public get(string $key): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
set
Sets a value in storage.
public set(string $key, mixed $value): void
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
unset
Unsets a value in storage.
public unset(string $key): void
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
clear
Clears data from storage.
public clear(): void
getToken
Returns the storage session token.
public getToken(): array<string,string>
Return Value:
Storage token should be an array with at least a 'token' key and optionally a 'refresh' key
Automatically generated on 2024-11-14