@@ -26,10 +26,11 @@ configuration format of your choice):
26
26
27
27
parameters :
28
28
pdo.db_options :
29
- db_table : session
30
- db_id_col : session_id
31
- db_data_col : session_value
32
- db_time_col : session_time
29
+ db_table : session
30
+ db_id_col : session_id
31
+ db_data_col : session_data
32
+ db_time_col : session_time
33
+ db_lifetime_col : session_lifetime
33
34
34
35
services :
35
36
pdo :
@@ -56,8 +57,9 @@ configuration format of your choice):
56
57
<parameter key =" pdo.db_options" type =" collection" >
57
58
<parameter key =" db_table" >session</parameter >
58
59
<parameter key =" db_id_col" >session_id</parameter >
59
- <parameter key =" db_data_col" >session_value </parameter >
60
+ <parameter key =" db_data_col" >session_data </parameter >
60
61
<parameter key =" db_time_col" >session_time</parameter >
62
+ <parameter key =" db_lifetime_col" >session_lifetime</parameter >
61
63
</parameter >
62
64
</parameters >
63
65
@@ -93,10 +95,11 @@ configuration format of your choice):
93
95
));
94
96
95
97
$container->setParameter('pdo.db_options', array(
96
- 'db_table' => 'session',
97
- 'db_id_col' => 'session_id',
98
- 'db_data_col' => 'session_value',
99
- 'db_time_col' => 'session_time',
98
+ 'db_table' => 'session',
99
+ 'db_id_col' => 'session_id',
100
+ 'db_data_col' => 'session_data',
101
+ 'db_time_col' => 'session_time',
102
+ 'db_lifetime_col' => 'session_lifetime',
100
103
));
101
104
102
105
$pdoDefinition = new Definition('PDO', array(
@@ -114,9 +117,10 @@ configuration format of your choice):
114
117
$container->setDefinition('session.handler.pdo', $storageDefinition);
115
118
116
119
* ``db_table ``: The name of the session table in your database
117
- * ``db_id_col ``: The name of the id column in your session table (VARCHAR(255) or larger )
118
- * ``db_data_col ``: The name of the value column in your session table (TEXT or CLOB )
120
+ * ``db_id_col ``: The name of the id column in your session table (VARCHAR(128) )
121
+ * ``db_data_col ``: The name of the value column in your session table (BLOB )
119
122
* ``db_time_col ``: The name of the time column in your session table (INTEGER)
123
+ * ``db_lifetime_col ``: The name of the lifetime column in your session table (INTEGER)
120
124
121
125
Sharing your Database Connection Information
122
126
--------------------------------------------
@@ -168,11 +172,11 @@ following (MySQL):
168
172
.. code-block :: sql
169
173
170
174
CREATE TABLE `session` (
171
- `session_id` varchar(255 ) NOT NULL,
172
- `session_value` text NOT NULL,
173
- `session_time` int(11) NOT NULL,
174
- PRIMARY KEY (`session_id`)
175
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
175
+ `session_id` VARBINARY(128 ) NOT NULL PRIMARY KEY ,
176
+ `session_data` BLOB NOT NULL,
177
+ `session_time` INTEGER UNSIGNED NOT NULL,
178
+ `session_lifetime` MEDIUMINT NOT NULL
179
+ ) COLLATE utf8_bin, ENGINE = InnoDB ;
176
180
177
181
PostgreSQL
178
182
~~~~~~~~~~
@@ -182,10 +186,10 @@ For PostgreSQL, the statement should look like this:
182
186
.. code-block :: sql
183
187
184
188
CREATE TABLE session (
185
- session_id character varying(255 ) NOT NULL,
186
- session_value text NOT NULL,
187
- session_time integer NOT NULL,
188
- CONSTRAINT session_pkey PRIMARY KEY (session_id)
189
+ session_id VARCHAR(128 ) NOT NULL PRIMARY KEY ,
190
+ session_data BYTEA NOT NULL,
191
+ session_time INTEGER NOT NULL,
192
+ session_lifetime INTEGER NOT NULL
189
193
);
190
194
191
195
Microsoft SQL Server
@@ -197,8 +201,9 @@ For MSSQL, the statement might look like the following:
197
201
198
202
CREATE TABLE [dbo].[session](
199
203
[session_id] [nvarchar](255) NOT NULL,
200
- [session_value ] [ntext] NOT NULL,
204
+ [session_data ] [ntext] NOT NULL,
201
205
[session_time] [int] NOT NULL,
206
+ [session_lifetime] [int] NOT NULL,
202
207
PRIMARY KEY CLUSTERED(
203
208
[session_id] ASC
204
209
) WITH (
0 commit comments