Session
Session
Session based authentication adapter
This authentication adapter uses the session cache to store the user identity and token.
Configuration Directives
autologin.period - default: 1
This is the period in which the autologin cookie will remain active (ie: will expire after this many days). The default is one day.
autologin.hash - default: md5
This is the hash algorithm used to encrypt the token placed in the cookie in the user's browser session. This data is hashed to ensure that it can not be manipulated by the user.
token.hash - default: md5
The token hash is the value stored in the session cache and is used to confirm that a user account is authenticated. As an added security measure we apply a hash to this value so that plain test passwords will never be stored in the session cache, even if there is no password encryption chain.
timeout - default: 3600
For a standard login, this is the session expirey timeout. Basically this is the maximum time in which a session will ever be active. If autologin is being used, then it is quite common to set this to a low value to allow the user to be re-authenticated with the autologin token periodically.
Properties
sessionKey
private string $sessionKey = 'hazaar_auth_storage'
session
private array $session
Methods
__construct
public __construct(array $config): void
Parameters
Parameter | Type | Description |
---|---|---|
$config | array |
isEmpty
public isEmpty(): bool
read
public read(): void
write
public write(array $data): void
Parameters
Parameter | Type | Description |
---|---|---|
$data | array |
has
public has(string $key): bool
Parameters
Parameter | Type | Description |
---|---|---|
$key | string |
get
public get(string $key): mixed
Parameters
Parameter | Type | Description |
---|---|---|
$key | string |
set
public set(string $key, mixed $value): void
Parameters
Parameter | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
public (string $key): void
Parameters
Parameter | Type | Description |
---|---|---|
$key | string |
clear
public clear(): void
getToken
public getToken(): void
Generated by Hazaar API Doc Generator