Class AbstractSession
Abstract session save handler.
Method Summary
-
close() public
Method called on close of a database session.
-
create_sid() public
Create a new session ID.
-
destroy() abstract public
Destroy a session.
-
gc() abstract public
Cleanup old sessions.
-
open() public
Method called on open of a database session.
-
read() abstract public
Read session data.
-
validateId() public
Validate a session ID.
-
write() abstract public
Write session data.
Method Detail
destroy() ¶ abstract public
destroy(string $id): bool
Destroy a session.
Parameters
-
string$id ID that uniquely identifies session in cache.
Returns
boolgc() ¶ abstract public
gc(int $max_lifetime): int|false
Cleanup old sessions.
Parameters
-
int$max_lifetime Sessions that have not updated for the last maxlifetime seconds will be removed.
Returns
int|falseopen() ¶ public
open(string $path, string $name): bool
Method called on open of a database session.
Parameters
-
string$path The path where to store/retrieve the session.
-
string$name The session name.
Returns
boolSuccess
read() ¶ abstract public
read(string $id): string|false
Read session data.
Parameters
-
string$id ID that uniquely identifies session in cache.
Returns
string|falseSession data or false if it does not exist.
validateId() ¶ public
validateId(string $id): bool
Validate a session ID.
Parameters
-
string$id The session ID to validate.
Returns
boolwrite() ¶ abstract public
write(string $id, string $data): bool
Write session data.
Parameters
-
string$id ID that uniquely identifies session in cache.
-
string$data The data to be saved.
Returns
boolTrue for successful write, false otherwise.