abstract | |
|---|---|
uses |
Hm_Session_Fingerprint |
Base class for session management. All session interaction happens through classes that extend this.
| Methods | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
abstract
protected
|
check(object $request): bool
check for an active session or an attempt to start one
check for an active session or an attempt to start one Parameters
Implemented by |
# | ||||||||||||
abstract
protected
|
start(object $request): void
Start the session. This could be an existing session or a new login
Start the session. This could be an existing session or a new login Parameters
Implemented by |
# | ||||||||||||
abstract
protected
|
auth(string $user, string $pass): bool
Call the configured authentication method to check user credentials
Call the configured authentication method to check user credentials Parameters
Returnstrue if the authentication was successful Implemented by |
# | ||||||||||||
abstract
protected
|
del(string $name): void
Delete a value from the session
Delete a value from the session Parameters
Implemented by |
# | ||||||||||||
abstract
protected
|
end(): void
End a session after a page request is complete. This only closes the session and
does not destroy it
End a session after a page request is complete. This only closes the session and does not destroy it Implemented by |
# | ||||||||||||
public
|
__construct(object $config, string $auth_type = 'Hm_Auth_DB')
Setup initial data
Setup initial data Parameters
|
# | ||||||||||||
protected
|
load_auth_mech(): void
Lazy loader for the auth mech so modules can define their own
overrides
Lazy loader for the auth mech so modules can define their own overrides |
# | ||||||||||||
public
|
dump(): array
Dump current session contents
Dump current session contents |
# | ||||||||||||
protected
|
just_started(): void
Method called on a new login
Method called on a new login |
# | ||||||||||||
public
|
record_unsaved(string $value): void
Record session level changes not yet saved in persistant storage
Record session level changes not yet saved in persistant storage Parameters
|
# | ||||||||||||
public
|
is_active(): bool
Returns bool true if the session is active
Returns bool true if the session is active |
# | ||||||||||||
public
|
is_admin(): bool
Returns bool true if the user is an admin
Returns bool true if the user is an admin |
# | ||||||||||||
public
|
ciphertext(array $data): string
Encrypt session data
Encrypt session data Parameters
Returnsencrypted session data |
# | ||||||||||||
public
|
plaintext(string $data): false|array
Decrypt session data
Decrypt session data Parameters
Returnsdecrpted session data |
# | ||||||||||||
protected
|
set_key(Hm_Request $request): void
Set the session level encryption key
Set the session level encryption key Parameters
|
# | ||||||||||||
public
|
get_key(object $request): void
Fetch the current encryption key
Fetch the current encryption key Parameters
|
# | ||||||||||||
public
|
secure_cookie(
object $request,
string $name,
string $value,
string $path = '',
string $domain = '',
string $same_site = 'Strict',
): boolean
Set a cookie, secure if possible
Set a cookie, secure if possible Parameters
|
# | ||||||||||||
public
|
delete_cookie(object $request, string $name, string $path = '', string $domain = ''): boolean
Delete a cookie
Delete a cookie Parameters
|
# | ||||||||||||
| Methods used from Hm_Session_Fingerprint |
|---|
set(), destroy(), get(), check_fingerprint(), build_fingerprint(), set_fingerprint() |
| Properties | |||
|---|---|---|---|
public
|
|
$loaded = false
|
# |
public
|
|
$active = false
|
# |
public
|
|
$internal_users = false
|
# |
public
|
|
$enc_key = ''
|
# |
public
|
|
$auth_class
|
# |
public
|
|
$site_config
|
# |
protected
|
|
$data = []
|
# |
protected
|
|
$cname = 'hm_session'
|
# |
protected
|
|
$auth_mech
|
# |
protected
|
|
$session_closed = false
|
# |
public
|
|
$session_key = ''
|
# |
public
|
|
$lifetime = 0
|
# |