__construct()
__construct(\PDO|string|null $pdoOrDsn = null, array $options = array())
You can either pass an existing database connection as PDO instance or
pass a DSN string that will be used to lazy-connect to the database
when the session is actually used. Furthermore it's possible to pass null
which will then use the session.save_path ini setting as PDO DSN parameter.
List of available options:
- db_table: The name of the table [default: sessions]
- db_id_col: The column where to store the session id [default: sess_id]
- db_data_col: The column where to store the session data [default: sess_data]
- db_lifetime_col: The column where to store the lifetime [default: sess_lifetime]
- db_time_col: The column where to store the timestamp [default: sess_time]
- db_username: The username when lazy-connect [default: '']
- db_password: The password when lazy-connect [default: '']
- db_connection_options: An array of driver-specific connection options [default: array()]
- lock_mode: The strategy for locking, see constants [default: LOCK_TRANSACTIONAL]
Parameters
\PDO|string|null |
$pdoOrDsn |
A \PDO instance or DSN string or URL string or null |
array |
$options |
An associative array of options |
Throws
- \InvalidArgumentException
When PDO error mode is not PDO::ERRMODE_EXCEPTION