@@ -1723,38 +1723,39 @@ and also to configure the session handler with a DSN:
1723
1723
name
1724
1724
....
1725
1725
1726
- **type **: ``string `` **default **: ``null ``
1726
+ **type **: ``string ``
1727
+
1728
+ This specifies the name of the session cookie.
1727
1729
1728
- This specifies the name of the session cookie. By default, it will use the
1729
- cookie name which is defined in the ``php.ini `` with the ``session.name ``
1730
- directive.
1730
+ If not set, ``php.ini ``'s `session.name `_ directive will be relied on.
1731
1731
1732
1732
cookie_lifetime
1733
1733
...............
1734
1734
1735
- **type **: ``integer `` ** default **: `` null ``
1735
+ **type **: ``integer ``
1736
1736
1737
- This determines the lifetime of the session - in seconds. The default value
1738
- - ``null `` - means that the ``session.cookie_lifetime `` value from ``php.ini ``
1739
- will be used. Setting this value to ``0 `` means the cookie is valid for
1737
+ This determines the lifetime of the session - in seconds.
1738
+ Setting this value to ``0 `` means the cookie is valid for
1740
1739
the length of the browser session.
1741
1740
1741
+ If not set, ``php.ini ``'s `session.cookie_lifetime `_ directive will be relied on.
1742
+
1742
1743
cookie_path
1743
1744
...........
1744
1745
1745
- **type **: ``string `` **default **: ``/ ``
1746
+ **type **: ``string ``
1747
+
1748
+ This determines the path to set in the session cookie.
1746
1749
1747
- This determines the path to set in the session cookie. By default, it will
1748
- use ``/ ``.
1750
+ If not set, ``php.ini ``'s `session.cookie_path `_ directive will be relied on.
1749
1751
1750
1752
cache_limiter
1751
1753
.............
1752
1754
1753
- **type **: ``string `` or `` int `` **default **: (an empty string)
1755
+ **type **: ``string `` **default **: `` 0 ``
1754
1756
1755
1757
If set to ``0 ``, Symfony won't set any particular header related to the cache
1756
- and it will rely on the cache control method configured in the
1757
- `session.cache-limiter `_ PHP.ini option.
1758
+ and it will rely on ``php.ini ``'s `session.cache_limiter `_ directive.
1758
1759
1759
1760
Unlike the other session options, ``cache_limiter `` is set as a regular
1760
1761
:ref: `container parameter <configuration-parameters >`:
@@ -1791,19 +1792,22 @@ Unlike the other session options, ``cache_limiter`` is set as a regular
1791
1792
'cache_limiter' => 0,
1792
1793
]);
1793
1794
1795
+ Be aware that if you configure it, you'll have to set other session-related options
1796
+ as parameters as well.
1797
+
1794
1798
cookie_domain
1795
1799
.............
1796
1800
1797
- **type **: ``string `` **default **: (an empty string)``''``
1801
+ **type **: ``string ``
1802
+
1803
+ This determines the domain to set in the session cookie.
1798
1804
1799
- This determines the domain to set in the session cookie. By default, it's
1800
- blank, meaning the host name of the server which generated the cookie according
1801
- to the cookie specification.
1805
+ If not set, ``php.ini ``'s `session.cookie_domain `_ directive will be relied on.
1802
1806
1803
1807
cookie_samesite
1804
1808
...............
1805
1809
1806
- **type **: ``string `` or ``null `` **default **: ``lax ``
1810
+ **type **: ``string `` or ``null `` **default **: ``null ``
1807
1811
1808
1812
It controls the way cookies are sent when the HTTP request did not originate
1809
1813
from the same domain that is associated with the cookies. Setting this option is
@@ -1817,8 +1821,7 @@ those cookies when making that HTTP request.
1817
1821
1818
1822
The possible values for this option are:
1819
1823
1820
- * ``null ``, use it to disable this protection. Same behavior as in older Symfony
1821
- versions.
1824
+ * ``null ``, use ``php.ini ``'s `session.cookie_samesite `_ directive.
1822
1825
* ``'none' `` (or the ``Symfony\Component\HttpFoundation\Cookie::SAMESITE_NONE `` constant), use it to allow
1823
1826
sending of cookies when the HTTP request originated from a different domain
1824
1827
(previously this was the default behavior of null, but in newer browsers ``'lax' ``
@@ -1833,12 +1836,14 @@ The possible values for this option are:
1833
1836
cookie_secure
1834
1837
.............
1835
1838
1836
- **type **: ``boolean `` or ``'auto' `` ** default **: `` auto ``
1839
+ **type **: ``boolean `` or ``'auto' ``
1837
1840
1838
1841
This determines whether cookies should only be sent over secure connections. In
1839
1842
addition to ``true `` and ``false ``, there's a special ``'auto' `` value that
1840
1843
means ``true `` for HTTPS requests and ``false `` for HTTP requests.
1841
1844
1845
+ If not set, ``php.ini ``'s `session.cookie_secure `_ directive will be relied on.
1846
+
1842
1847
cookie_httponly
1843
1848
...............
1844
1849
@@ -1852,10 +1857,12 @@ identity theft through XSS attacks.
1852
1857
gc_divisor
1853
1858
..........
1854
1859
1855
- **type **: ``integer `` ** default **: `` 100 ``
1860
+ **type **: ``integer ``
1856
1861
1857
1862
See `gc_probability `_.
1858
1863
1864
+ If not set, ``php.ini ``'s `session.gc_divisor `_ directive will be relied on.
1865
+
1859
1866
gc_probability
1860
1867
..............
1861
1868
@@ -1869,45 +1876,46 @@ chance that the GC process will start on each request.
1869
1876
gc_maxlifetime
1870
1877
..............
1871
1878
1872
- **type **: ``integer `` ** default **: `` 1440 ``
1879
+ **type **: ``integer ``
1873
1880
1874
1881
This determines the number of seconds after which data will be seen as "garbage"
1875
1882
and potentially cleaned up. Garbage collection may occur during session
1876
1883
start and depends on `gc_divisor `_ and `gc_probability `_.
1877
1884
1885
+ If not set, ``php.ini ``'s `session.gc_maxlifetime `_ directive will be relied on.
1886
+
1878
1887
sid_length
1879
1888
..........
1880
1889
1881
- **type **: ``integer `` ** default **: `` 32 ``
1890
+ **type **: ``integer ``
1882
1891
1883
1892
This determines the length of session ID string, which can be an integer between
1884
- ``22 `` and ``256 `` (both inclusive), being ``32 `` the recommended value. Longer
1893
+ ``22 `` and ``256 `` (both inclusive), ``32 `` being the recommended value. Longer
1885
1894
session IDs are harder to guess.
1886
1895
1887
- This option is related to the `session.sid_length PHP option `_ .
1896
+ If not set, `` php.ini ``'s `session.sid_length `_ directive will be relied on .
1888
1897
1889
1898
sid_bits_per_character
1890
1899
......................
1891
1900
1892
- **type **: ``integer `` ** default **: `` 4 ``
1901
+ **type **: ``integer ``
1893
1902
1894
1903
This determines the number of bits in the encoded session ID character. The possible
1895
1904
values are ``4 `` (0-9, a-f), ``5 `` (0-9, a-v), and ``6 `` (0-9, a-z, A-Z, "-", ",").
1896
1905
The more bits results in stronger session ID. ``5 `` is recommended value for
1897
1906
most environments.
1898
1907
1899
- This option is related to the `session.sid_bits_per_character PHP option `_ .
1908
+ If not set, `` php.ini ``'s `session.sid_bits_per_character `_ directive will be relied on .
1900
1909
1901
1910
save_path
1902
1911
.........
1903
1912
1904
- **type **: ``string `` **default **: ``%kernel.cache_dir%/sessions ``
1913
+ **type **: ``string `` or `` null `` **default **: ``%kernel.cache_dir%/sessions ``
1905
1914
1906
1915
This determines the argument to be passed to the save handler. If you choose
1907
1916
the default file handler, this is the path where the session files are created.
1908
1917
1909
- You can also set this value to the ``save_path `` of your ``php.ini `` by
1910
- setting the value to ``null ``:
1918
+ If ``null ``, ``php.ini ``'s `session.save_path `_ directive will be relied on:
1911
1919
1912
1920
.. configuration-block ::
1913
1921
@@ -2002,11 +2010,12 @@ Whether to enable the session support in the framework.
2002
2010
use_cookies
2003
2011
...........
2004
2012
2005
- **type **: ``boolean `` ** default **: `` null ``
2013
+ **type **: ``boolean ``
2006
2014
2007
2015
This specifies if the session ID is stored on the client side using cookies or
2008
- not. By default, it will use the value defined in the ``php.ini `` with the
2009
- ``session.use_cookies `` directive.
2016
+ not.
2017
+
2018
+ If not set, ``php.ini ``'s `session.use_cookies `_ directive will be relied on.
2010
2019
2011
2020
ssi
2012
2021
~~~
@@ -3884,14 +3893,24 @@ the ``#[WithLogLevel]`` attribute::
3884
3893
.. _`json_encode flags bitmask` : https://www.php.net/json_encode
3885
3894
.. _`error_reporting PHP option` : https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting
3886
3895
.. _`CSRF security attacks` : https://en.wikipedia.org/wiki/Cross-site_request_forgery
3887
- .. _`session.sid_length PHP option` : https://www.php.net/manual/session.configuration.php#ini.session.sid-length
3888
- .. _`session.sid_bits_per_character PHP option` : https://www.php.net/manual/session.configuration.php#ini.session.sid-bits-per-character
3889
3896
.. _`X-Robots-Tag HTTP header` : https://developers.google.com/search/reference/robots_meta_tag
3890
3897
.. _`RFC 3986` : https://www.ietf.org/rfc/rfc3986.txt
3891
3898
.. _`default_socket_timeout` : https://www.php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout
3892
3899
.. _`PEM formatted` : https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail
3893
3900
.. _`haveibeenpwned.com` : https://haveibeenpwned.com/
3894
- .. _`session.cache-limiter` : https://www.php.net/manual/en/session.configuration.php#ini.session.cache-limiter
3901
+ .. _`session.name` : https://www.php.net/manual/en/session.configuration.php#ini.session.name
3902
+ .. _`session.cookie_lifetime` : https://www.php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime
3903
+ .. _`session.cookie_path` : https://www.php.net/manual/en/session.configuration.php#ini.session.cookie-path
3904
+ .. _`session.cache_limiter` : https://www.php.net/manual/en/session.configuration.php#ini.session.cache-limiter
3905
+ .. _`session.cookie_domain` : https://www.php.net/manual/en/session.configuration.php#ini.session.cookie-domain
3906
+ .. _`session.cookie_samesite` : https://www.php.net/manual/en/session.configuration.php#ini.session.cookie-samesite
3907
+ .. _`session.cookie_secure` : https://www.php.net/manual/en/session.configuration.php#ini.session.cookie-secure
3908
+ .. _`session.gc_divisor` : https://www.php.net/manual/en/session.configuration.php#ini.session.gc-divisor
3909
+ .. _`session.gc_maxlifetime` : https://www.php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime
3910
+ .. _`session.sid_length` : https://www.php.net/manual/en/session.configuration.php#ini.session.sid-length
3911
+ .. _`session.sid_bits_per_character` : https://www.php.net/manual/en/session.configuration.php#ini.session.sid-bits-per-character
3912
+ .. _`session.save_path` : https://www.php.net/manual/en/session.configuration.php#ini.session.save-path
3913
+ .. _`session.use_cookies` : https://www.php.net/manual/en/session.configuration.php#ini.session.use-cookies
3895
3914
.. _`Microsoft NTLM authentication protocol` : https://docs.microsoft.com/en-us/windows/win32/secauthn/microsoft-ntlm
3896
3915
.. _`utf-8 modifier` : https://www.php.net/reference.pcre.pattern.modifiers
3897
3916
.. _`Link HTTP header` : https://tools.ietf.org/html/rfc5988
0 commit comments