extends |
Hm_PHP_Session |
|---|
Override the session class. These are the methods that must be overriden to create a new session backend. The "session_type" value in your config/app.php must be set to "custom" to activate this class. There are several other properties and methods that can be modified to create custom sessions:
https://cypht.org/docs/code_docs/class-Hm_Session.html
This example extends the standard PHP session class. You can also extend the DB or Memcached classes, or the base session class. In this example we just defer to the PHP session class methods.
| Methods | ||||||||
|---|---|---|---|---|---|---|---|---|
public
|
check(object $request, $user = false, $pass = false, $fingerprint = true): bool
check for an active session or an attempt to start one
check for an active session or an attempt to start one Parameters
Overrides |
# | ||||||
public
|
start(object $request, $existing_session = false): 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
Overrides |
# | ||||||
public
|
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 Implements |
# | ||||||
public
|
get(string $name, mixed $default = false, $user = false): mixed
Return a session value, or a user settings value stored in the session
Return a session value, or a user settings value stored in the session Parameters
Returnsthe value if found, otherwise $defaultHm_Auth Overrides |
# | ||||||
public
|
set(string $name, string $value, $user = false): void
Save a value in the session
Save a value in the session Parameters
Overrides |
# | ||||||
public
|
del(string $name): void
Delete a value from the session
Delete a value from the session Parameters
Overrides |
# | ||||||
public
|
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 Overrides |
# | ||||||
public
|
destroy(object $request): void
Destroy a session for good
|
# | ||||||
| Methods inherited from Hm_PHP_Session |
|---|
authed(), set_session_params(), close_early(), |
| Methods inherited from Hm_PHP_Session_Data |
|---|
validate_session_data(), start_session_data(), save_data() |
| Methods inherited from Hm_Session |
|---|
__construct(), load_auth_mech(), dump(), just_started(), record_unsaved(), is_active(), is_admin(), ciphertext(), plaintext(), set_key(), get_key(), secure_cookie(), delete_cookie() |
| Methods used from Hm_Session_Fingerprint |
|---|
check_fingerprint(), build_fingerprint(), set_fingerprint() |
| Methods used from Hm_Session_Auth |
|---|
load_auth_mech(), save_auth_detail(), change_pass(), create() |
| Properties inherited from Hm_PHP_Session |
|---|
$conn, $existing |
| Properties inherited from Hm_Session |
|---|
$loaded, $active, $internal_users, $enc_key, $auth_class, $site_config, $data, $cname, $auth_mech, $session_closed, $session_key, $lifetime |