Class DatabaseSession
DatabaseSession provides methods to be used with Session.
Property Summary
Method Summary
- 
          __construct() publicConstructor. Looks at Session configuration information and sets up the session model. 
- 
          close() publicMethod called on close of a database session. 
- 
          destroy() publicMethod called on the destruction of a database session. 
- 
          gc() publicHelper function called on gc for database sessions. 
- 
          open() publicMethod called on open of a database session. 
- 
          read() publicMethod used to read from a database session. 
- 
          write() publicHelper function called on write for database sessions. 
Method Detail
__construct() ¶ public
__construct(array $config = [])Constructor. Looks at Session configuration information and sets up the session model.
Parameters
- 
                array$config optional
- The configuration for this engine. It requires the 'model' key to be present corresponding to the Table to use for managing the sessions. 
destroy() ¶ public
destroy(int $id): boolMethod called on the destruction of a database session.
Parameters
- 
                int$id
- ID that uniquely identifies session in database 
Returns
boolTrue for successful delete, false otherwise.
gc() ¶ public
gc(string $maxlifetime): boolHelper function called on gc for database sessions.
Parameters
- 
                string$maxlifetime
- Sessions that have not updated for the last maxlifetime seconds will be removed. 
Returns
boolTrue on success, false on failure.
open() ¶ public
open(string $savePath, string $name): boolMethod called on open of a database session.
Parameters
- 
                string$savePath
- The path where to store/retrieve the session. 
- 
                string$name
- The session name. 
Returns
boolSuccess
read() ¶ public
read(int|string $id): stringMethod used to read from a database session.
Parameters
- 
                int|string$id
- The key of the value to read 
Returns
stringThe value of the key or empty if it does not exist
write() ¶ public
write(int $id, mixed $data): boolHelper function called on write for database sessions.
Parameters
- 
                int$id
- ID that uniquely identifies session in database 
- 
                mixed$data
- The value of the data to be saved. 
Returns
boolTrue for successful write, false otherwise.
