Skip to content

Commit fc42e60

Browse files
committed
Added a mention to the createTable() method of the session handler
1 parent c83e12e commit fc42e60

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

doctrine/pdo_session_storage.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ a second array argument to ``PdoSessionHandler``:
143143
The ``db_lifetime_col`` was introduced in Symfony 2.6. Prior to 2.6,
144144
this column did not exist.
145145

146-
These are parameters that you must configure:
146+
These are parameters that you can configure:
147147

148148
``db_table`` (default ``sessions``):
149149
The name of the session table in your database;
@@ -216,8 +216,18 @@ Preparing the Database to Store Sessions
216216
----------------------------------------
217217

218218
Before storing sessions in the database, you must create the table that stores
219-
the information. The following sections contain some examples of the SQL statements
220-
you may use for your specific database engine.
219+
the information. The session handler provides a method called
220+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler::createTable`
221+
to set up this table for you according to the database engine used::
222+
223+
try {
224+
$sessionHandlerService->createTable();
225+
} catch (\PDOException $e) {
226+
// the table could not be created for some reason
227+
}
228+
229+
If you prefer to set up the table yourself, these are some examples of the SQL
230+
statements you may use according to your specific database engine.
221231

222232
.. _pdo-session-handle-26-changes:
223233

0 commit comments

Comments
 (0)