SessionDatabaseDriver
extends CI_Session_database_driver
in package
CI_Session_database_driver extension.
Added reading of additional columns (application/config/config.php - sess_table_additional_columns) to be stored in the session management table.
Table of Contents
Methods
- __construct() : mixed
- Initialize SessionDatabaseDriver.
- read() : string
- Reads session data and acquires a lock.
- write() : bool
- Writes (create / update) session data
- addAdditionalColumnsToTableData() : array<string|int, mixed>
- Add additional columns to table data.
- unserialize() : array<string|int, mixed>|null
- Unserialize the session.
Methods
__construct()
Initialize SessionDatabaseDriver.
public
__construct(array<string|int, mixed> &$params) : mixed
Parameters
- $params : array<string|int, mixed>
-
Configuration parameters.
read()
Reads session data and acquires a lock.
public
read(string $sessionId) : string
Parameters
- $sessionId : string
-
Session ID.
Return values
string —Serialized session data.
write()
Writes (create / update) session data
public
write(string $sessionId, string $sessionData) : bool
Parameters
- $sessionId : string
-
Session ID.
- $sessionData : string
-
Serialized session data.
Return values
bool —Whether the session was successfully written or not.
addAdditionalColumnsToTableData()
Add additional columns to table data.
private
addAdditionalColumnsToTableData(array<string|int, mixed> $insertData, string $sessionData) : array<string|int, mixed>
Parameters
- $insertData : array<string|int, mixed>
-
Data to be registered in the session table.
- $sessionData : string
-
Session data.
Return values
array<string|int, mixed> —Registration data for session tables with additional column information.
unserialize()
Unserialize the session.
private
unserialize(string $data) : array<string|int, mixed>|null
Parameters
- $data : string
-
Serialized session data.
Return values
array<string|int, mixed>|null —Unserialized session data.