$pdo
$pdo : \PDO
Session handler using a PDO connection to read and write data.
Session data is a binary string that can contain non-printable characters like the null byte. For this reason this handler base64 encodes the data to be able to save it in a character column.
This version of the PdoSessionHandler does NOT implement locking. So concurrent requests to the same session can result in data loss due to race conditions.
__construct(\PDO $pdo, array $dbOptions = array())
Constructor.
List of available options:
| \PDO | $pdo | A \PDO instance |
| array | $dbOptions | An associative array of DB options |
When "db_table" option is not provided
open(string $savePath, string $sessionName) : boolean
Re-initializes existing session, or creates a new one.
| string | $savePath | Save path |
| string | $sessionName | Session name, see http://php.net/function.session-name.php |
true on success, false on failure
destroy(string $sessionId) : boolean
Destroys a session.
| string | $sessionId | Session ID, see http://php.net/function.session-id |
true on success, false on failure
read(string $sessionId) : string
Reads the session data.
| string | $sessionId | Session ID, see http://php.net/function.session-id |
Same session data as passed in write() or empty string when non-existent or on failure
write(string $sessionId, string $data) : boolean
Writes the session data to the storage.
Care, the session ID passed to write() can be different from the one previously received in read() when the session ID changed due to session_regenerate_id().
| string | $sessionId | Session ID , see http://php.net/function.session-id |
| string | $data | Serialized session data to save |
true on success, false on failure