|
| abort () |
| Release lock on the session without writing it.
|
|
| add_session (int $userid) |
| Insert new empty session record.
|
|
| destroy (string $id) |
| Destroy a specific session and delete this session record for this session id.
|
|
| destroy_all () |
| Destroy all sessions, and delete all the session data.
|
|
| destroy_by_auth_plugin (string $pluginname) |
| Destroy all sessions for a given plugin.
|
|
| gc (int $max_lifetime=0) |
| Periodic timed-out session cleanup.
|
|
| get_all_sessions () |
| Returns all session records.
|
|
| get_session_by_sid (string $sid) |
| Returns a single session record for this session id.
|
|
| get_sessions_by_userid (int $userid) |
| Returns all the session records for this user id.
|
|
| init () |
| Init session handler.
|
|
| requires_write_lock () |
| Has this session been opened with a writelock?
|
|
| session_exists ($sid) |
| Check the backend contains data for this session id.
|
|
| set_requires_write_lock ($requireswritelock) |
| This is called after init() and before start() to indicate whether the session opened should be writable or not.
|
|
| start () |
| Start the session.
|
|
| update_session (stdClass $record) |
| Update a session record.
|
|
| write_close () |
| Write the session and release lock.
|
|
|
boolean | $requireswritelock = false |
| $requireswritelock does the session need and/or have a lock?
|
|
◆ abort()
core\session\handler::abort |
( |
| ) |
|
Release lock on the session without writing it.
May not be possible in older versions of PHP. If so, session may be written anyway so that any locks are released.
◆ add_session()
core\session\handler::add_session |
( |
int | $userid | ) |
|
Insert new empty session record.
- Parameters
-
- Return values
-
Reimplemented in core\session\redis.
◆ destroy()
core\session\handler::destroy |
( |
string | $id | ) |
|
◆ destroy_all()
core\session\handler::destroy_all |
( |
| ) |
|
◆ destroy_all_expired_sessions()
core\session\handler::destroy_all_expired_sessions |
( |
int | $purgebefore | ) |
|
|
protected |
Clean up all expired sessions.
- Parameters
-
◆ destroy_by_auth_plugin()
core\session\handler::destroy_by_auth_plugin |
( |
string | $pluginname | ) |
|
Destroy all sessions for a given plugin.
Typically used when a plugin is disabled or uninstalled, so all sessions (users) for that plugin are logged out.
- Parameters
-
string | $pluginname | Auth plugin name. |
◆ destroy_expired_user_sessions()
core\session\handler::destroy_expired_user_sessions |
( |
int | $purgebefore, |
|
|
int | $userid ) |
|
protected |
Clean up expired sessions.
- Parameters
-
int | $purgebefore | Sessions that have not updated for the last purgebefore timestamp will be removed. |
int | $userid | |
◆ gc()
core\session\handler::gc |
( |
int | $max_lifetime = 0 | ) |
|
Periodic timed-out session cleanup.
- Parameters
-
int | $max_lifetime | Sessions that have not updated for the last max_lifetime seconds will be removed. |
- Return values
-
int|false | Number of deleted sessions or false if an error occurred. |
Reimplemented in core\session\redis.
◆ get_all_sessions()
core\session\handler::get_all_sessions |
( |
| ) |
|
◆ get_session_by_sid()
core\session\handler::get_session_by_sid |
( |
string | $sid | ) |
|
Returns a single session record for this session id.
- Parameters
-
- Return values
-
Reimplemented in core\session\redis.
◆ get_sessions_by_userid()
core\session\handler::get_sessions_by_userid |
( |
int | $userid | ) |
|
Returns all the session records for this user id.
- Parameters
-
- Return values
-
Reimplemented in core\session\redis.
◆ init()
core\session\handler::init |
( |
| ) |
|
|
abstract |
◆ requires_write_lock()
core\session\handler::requires_write_lock |
( |
| ) |
|
Has this session been opened with a writelock?
Your handler should call this during start() if you support read-only sessions.
- Return values
-
bool | true if session is intended to have a write lock. |
◆ session_exists()
core\session\handler::session_exists |
( |
| $sid | ) |
|
|
abstract |
◆ set_requires_write_lock()
core\session\handler::set_requires_write_lock |
( |
| $requireswritelock | ) |
|
This is called after init() and before start() to indicate whether the session opened should be writable or not.
This is intentionally captured even if your handler doesn't support non-locking sessions, so that behavior (upon session close) matches closely between handlers.
- Parameters
-
bool | $requireswritelock | true if needs to be open for writing |
◆ start()
core\session\handler::start |
( |
| ) |
|
◆ update_session()
core\session\handler::update_session |
( |
stdClass | $record | ) |
|
Update a session record.
- Parameters
-
- Return values
-
◆ write_close()
core\session\handler::write_close |
( |
| ) |
|
Write the session and release lock.
If the session was not intentionally opened with a write lock, then we will abort the session instead if able.
The documentation for this class was generated from the following file:
- lib/classes/session/handler.php