Skip to content

Commit cce310f

Browse files
humandbweaverryan
authored andcommitted
Update reference/configuration/framework.rst
Improving the documentation for ``session`` according to the Configuration file (https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php#L192)
1 parent c5ebfd0 commit cce310f

File tree

1 file changed

+84
-3
lines changed

1 file changed

+84
-3
lines changed

reference/configuration/framework.rst

Lines changed: 84 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,15 @@ Configuration
2525
* enabled
2626
* field_name
2727
* `session`_
28-
* `lifetime`_
28+
* `cookie_lifetime`_
29+
* `cookie_path`_
30+
* `cookie_domain`_
31+
* `cookie_secure`_
32+
* `cookie_httponly`_
33+
* `gc_divisor`_
34+
* `gc_probability`_
35+
* `gc_maxlifetime`_
36+
* `save_path`_
2937
* `templating`_
3038
* `assets_base_urls`_
3139
* `assets_version`_
@@ -137,14 +145,87 @@ csrf_protection
137145
session
138146
~~~~~~~
139147

140-
lifetime
141-
........
148+
cookie_lifetime
149+
...............
142150

143151
**type**: ``integer`` **default**: ``0``
144152

145153
This determines the lifetime of the session - in seconds. By default it will use
146154
``0``, which means the cookie is valid for the length of the browser session.
147155

156+
In Symfony 2.1 and before this option was formerly know as ``lifetime``.
157+
158+
cookie_path
159+
...........
160+
161+
**type**: ``string`` **default**: ``/``
162+
163+
This determines the path to set in the session cookie. By default it will use ``/``.
164+
165+
In Symfony 2.1 and before this option was formerly known as ``path``.
166+
167+
cookie_domain
168+
.............
169+
170+
**type**: ``string`` **default**: ````
171+
172+
This determines the domain to set in the session cookie. By default it's blank meaning the
173+
host name of the server which generated the cookie according to the cookie specification.
174+
175+
In Symfony 2.1 and before this option was formerly known as ``domain``.
176+
177+
cookie_secure
178+
.............
179+
180+
**type**: ``Boolean`` **default**: ``false``
181+
182+
This determines whether cookies should only be sent over secure connections.
183+
184+
In Symfony 2.1 and before this option was formerly known as ``secure``.
185+
186+
cookie_httponly
187+
...............
188+
189+
**type**: ``Boolean`` **default**: ``false``
190+
191+
This determines whether cookies should only accesible through the HTTP protocol. This means
192+
that the cookie won't be accesible by scripting languages, such as Javascript. This setting
193+
can effectively help to reduce identity theft through XSS attacks.
194+
195+
In Symfony 2.1 and before this option was formerly known as ``httponly``.
196+
197+
gc_probability
198+
..............
199+
200+
**type**: ``integer`` **default**: ``1``
201+
202+
This defines the probability that the garbage collector (GC) process is started on every session
203+
initialization. The probability is calculated by using ``gc_probability``_ / ``gc_divisor``_,
204+
e.g. 1/100 means there is a 1% chance that the GC process start on each request.
205+
206+
gc_divisor
207+
..........
208+
209+
**type**: ``integer`` **default**: ``1``
210+
211+
See ``gc_probability``_.
212+
213+
gc_maxlifetime
214+
..............
215+
216+
**type**: ``integer`` **default**: ``14400``
217+
218+
This determines the number of seconds after whih data will be seen as `garbage` and potentially cleaned up.
219+
Garbage collection may occur during session start and depends on ``gc_divisor``_ and ``gc_probability``_.
220+
221+
save_path
222+
..............
223+
224+
**type**: ``string`` **default**: ``%kernel.cache.dir%/sessions``
225+
226+
This determines the argument to be passed to the save handler. If you choose the default files handler,
227+
this is the path where the files are created.
228+
148229
templating
149230
~~~~~~~~~~
150231

0 commit comments

Comments
 (0)