@@ -1688,38 +1688,39 @@ and also to configure the session handler with a DSN:
1688
1688
name
1689
1689
....
1690
1690
1691
- **type **: ``string `` **default **: ``null ``
1691
+ **type **: ``string ``
1692
+
1693
+ This specifies the name of the session cookie.
1692
1694
1693
- This specifies the name of the session cookie. By default, it will use the
1694
- cookie name which is defined in the ``php.ini `` with the ``session.name ``
1695
- directive.
1695
+ If not set, ``php.ini ``'s `session.name `_ directive will be relied on.
1696
1696
1697
1697
cookie_lifetime
1698
1698
...............
1699
1699
1700
- **type **: ``integer `` ** default **: `` null ``
1700
+ **type **: ``integer ``
1701
1701
1702
- This determines the lifetime of the session - in seconds. The default value
1703
- - ``null `` - means that the ``session.cookie_lifetime `` value from ``php.ini ``
1704
- will be used. Setting this value to ``0 `` means the cookie is valid for
1702
+ This determines the lifetime of the session - in seconds.
1703
+ Setting this value to ``0 `` means the cookie is valid for
1705
1704
the length of the browser session.
1706
1705
1706
+ If not set, ``php.ini ``'s `session.cookie_lifetime `_ directive will be relied on.
1707
+
1707
1708
cookie_path
1708
1709
...........
1709
1710
1710
- **type **: ``string `` **default **: ``/ ``
1711
+ **type **: ``string ``
1712
+
1713
+ This determines the path to set in the session cookie.
1711
1714
1712
- This determines the path to set in the session cookie. By default, it will
1713
- use ``/ ``.
1715
+ If not set, ``php.ini ``'s `session.cookie_path `_ directive will be relied on.
1714
1716
1715
1717
cache_limiter
1716
1718
.............
1717
1719
1718
- **type **: ``string `` or `` int `` **default **: ``'' ``
1720
+ **type **: ``string `` **default **: ``0 ``
1719
1721
1720
1722
If set to ``0 ``, Symfony won't set any particular header related to the cache
1721
- and it will rely on the cache control method configured in the
1722
- `session.cache-limiter `_ PHP.ini option.
1723
+ and it will rely on ``php.ini ``'s `session.cache_limiter `_ directive.
1723
1724
1724
1725
Unlike the other session options, ``cache_limiter `` is set as a regular
1725
1726
:ref: `container parameter <configuration-parameters >`:
@@ -1756,19 +1757,22 @@ Unlike the other session options, ``cache_limiter`` is set as a regular
1756
1757
'cache_limiter' => 0,
1757
1758
]);
1758
1759
1760
+ Be aware that if you configure it, you'll have to set other session-related options
1761
+ as parameters as well.
1762
+
1759
1763
cookie_domain
1760
1764
.............
1761
1765
1762
- **type **: ``string `` **default **: ``'' ``
1766
+ **type **: ``string ``
1767
+
1768
+ This determines the domain to set in the session cookie.
1763
1769
1764
- This determines the domain to set in the session cookie. By default, it's
1765
- blank, meaning the host name of the server which generated the cookie according
1766
- to the cookie specification.
1770
+ If not set, ``php.ini ``'s `session.cookie_domain `_ directive will be relied on.
1767
1771
1768
1772
cookie_samesite
1769
1773
...............
1770
1774
1771
- **type **: ``string `` or ``null `` **default **: ``lax ``
1775
+ **type **: ``string `` or ``null `` **default **: ``null ``
1772
1776
1773
1777
It controls the way cookies are sent when the HTTP request did not originate
1774
1778
from the same domain that is associated with the cookies. Setting this option is
@@ -1782,8 +1786,7 @@ those cookies when making that HTTP request.
1782
1786
1783
1787
The possible values for this option are:
1784
1788
1785
- * ``null ``, use it to disable this protection. Same behavior as in older Symfony
1786
- versions.
1789
+ * ``null ``, use ``php.ini ``'s `session.cookie_samesite `_ directive.
1787
1790
* ``'none' `` (or the ``Symfony\Component\HttpFoundation\Cookie::SAMESITE_NONE `` constant), use it to allow
1788
1791
sending of cookies when the HTTP request originated from a different domain
1789
1792
(previously this was the default behavior of null, but in newer browsers ``'lax' ``
@@ -1797,18 +1800,20 @@ The possible values for this option are:
1797
1800
1798
1801
.. note ::
1799
1802
1800
- This option is available starting from PHP 7.3, but Symfony has a polyfill
1801
- so you can use it with any older PHP version as well.
1803
+ Same-site cookies are a PHP 7.3 feature , but Symfony has a polyfill
1804
+ so you can set this option with any older PHP version as well.
1802
1805
1803
1806
cookie_secure
1804
1807
.............
1805
1808
1806
- **type **: ``boolean `` or ``'auto' `` ** default **: `` auto ``
1809
+ **type **: ``boolean `` or ``'auto' ``
1807
1810
1808
1811
This determines whether cookies should only be sent over secure connections. In
1809
1812
addition to ``true `` and ``false ``, there's a special ``'auto' `` value that
1810
1813
means ``true `` for HTTPS requests and ``false `` for HTTP requests.
1811
1814
1815
+ If not set, ``php.ini ``'s `session.cookie_secure `_ directive will be relied on.
1816
+
1812
1817
cookie_httponly
1813
1818
...............
1814
1819
@@ -1822,10 +1827,12 @@ identity theft through XSS attacks.
1822
1827
gc_divisor
1823
1828
..........
1824
1829
1825
- **type **: ``integer `` ** default **: `` 100 ``
1830
+ **type **: ``integer ``
1826
1831
1827
1832
See `gc_probability `_.
1828
1833
1834
+ If not set, ``php.ini ``'s `session.gc_divisor `_ directive will be relied on.
1835
+
1829
1836
gc_probability
1830
1837
..............
1831
1838
@@ -1839,45 +1846,46 @@ chance that the GC process will start on each request.
1839
1846
gc_maxlifetime
1840
1847
..............
1841
1848
1842
- **type **: ``integer `` ** default **: `` 1440 ``
1849
+ **type **: ``integer ``
1843
1850
1844
1851
This determines the number of seconds after which data will be seen as "garbage"
1845
1852
and potentially cleaned up. Garbage collection may occur during session
1846
1853
start and depends on `gc_divisor `_ and `gc_probability `_.
1847
1854
1855
+ If not set, ``php.ini ``'s `session.gc_maxlifetime `_ directive will be relied on.
1856
+
1848
1857
sid_length
1849
1858
..........
1850
1859
1851
- **type **: ``integer `` ** default **: `` 32 ``
1860
+ **type **: ``integer ``
1852
1861
1853
1862
This determines the length of session ID string, which can be an integer between
1854
- ``22 `` and ``256 `` (both inclusive), being ``32 `` the recommended value. Longer
1863
+ ``22 `` and ``256 `` (both inclusive), ``32 `` being the recommended value. Longer
1855
1864
session IDs are harder to guess.
1856
1865
1857
- This option is related to the `session.sid_length PHP option `_ .
1866
+ If not set, `` php.ini ``'s `session.sid_length `_ directive will be relied on .
1858
1867
1859
1868
sid_bits_per_character
1860
1869
......................
1861
1870
1862
- **type **: ``integer `` ** default **: `` 4 ``
1871
+ **type **: ``integer ``
1863
1872
1864
1873
This determines the number of bits in the encoded session ID character. The possible
1865
1874
values are ``4 `` (0-9, a-f), ``5 `` (0-9, a-v), and ``6 `` (0-9, a-z, A-Z, "-", ",").
1866
1875
The more bits results in stronger session ID. ``5 `` is recommended value for
1867
1876
most environments.
1868
1877
1869
- This option is related to the `session.sid_bits_per_character PHP option `_ .
1878
+ If not set, `` php.ini ``'s `session.sid_bits_per_character `_ directive will be relied on .
1870
1879
1871
1880
save_path
1872
1881
.........
1873
1882
1874
- **type **: ``string `` **default **: ``%kernel.cache_dir%/sessions ``
1883
+ **type **: ``string `` or `` null `` **default **: ``%kernel.cache_dir%/sessions ``
1875
1884
1876
1885
This determines the argument to be passed to the save handler. If you choose
1877
1886
the default file handler, this is the path where the session files are created.
1878
1887
1879
- You can also set this value to the ``save_path `` of your ``php.ini `` by
1880
- setting the value to ``null ``:
1888
+ If ``null ``, ``php.ini ``'s `session.save_path `_ directive will be relied on:
1881
1889
1882
1890
.. configuration-block ::
1883
1891
@@ -1972,11 +1980,12 @@ Whether to enable the session support in the framework.
1972
1980
use_cookies
1973
1981
...........
1974
1982
1975
- **type **: ``boolean `` ** default **: `` null ``
1983
+ **type **: ``boolean ``
1976
1984
1977
1985
This specifies if the session ID is stored on the client side using cookies or
1978
- not. By default, it will use the value defined in the ``php.ini `` with the
1979
- ``session.use_cookies `` directive.
1986
+ not.
1987
+
1988
+ If not set, ``php.ini ``'s `session.use_cookies `_ directive will be relied on.
1980
1989
1981
1990
ssi
1982
1991
~~~
@@ -3769,14 +3778,24 @@ use the configuration of the first exception that matches ``instanceof``:
3769
3778
.. _`json_encode flags bitmask` : https://www.php.net/json_encode
3770
3779
.. _`error_reporting PHP option` : https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting
3771
3780
.. _`CSRF security attacks` : https://en.wikipedia.org/wiki/Cross-site_request_forgery
3772
- .. _`session.sid_length PHP option` : https://www.php.net/manual/session.configuration.php#ini.session.sid-length
3773
- .. _`session.sid_bits_per_character PHP option` : https://www.php.net/manual/session.configuration.php#ini.session.sid-bits-per-character
3774
3781
.. _`X-Robots-Tag HTTP header` : https://developers.google.com/search/reference/robots_meta_tag
3775
3782
.. _`RFC 3986` : https://www.ietf.org/rfc/rfc3986.txt
3776
3783
.. _`default_socket_timeout` : https://www.php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout
3777
3784
.. _`PEM formatted` : https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail
3778
3785
.. _`haveibeenpwned.com` : https://haveibeenpwned.com/
3779
- .. _`session.cache-limiter` : https://www.php.net/manual/en/session.configuration.php#ini.session.cache-limiter
3786
+ .. _`session.name` : https://www.php.net/manual/en/session.configuration.php#ini.session.name
3787
+ .. _`session.cookie_lifetime` : https://www.php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime
3788
+ .. _`session.cookie_path` : https://www.php.net/manual/en/session.configuration.php#ini.session.cookie-path
3789
+ .. _`session.cache_limiter` : https://www.php.net/manual/en/session.configuration.php#ini.session.cache-limiter
3790
+ .. _`session.cookie_domain` : https://www.php.net/manual/en/session.configuration.php#ini.session.cookie-domain
3791
+ .. _`session.cookie_samesite` : https://www.php.net/manual/en/session.configuration.php#ini.session.cookie-samesite
3792
+ .. _`session.cookie_secure` : https://www.php.net/manual/en/session.configuration.php#ini.session.cookie-secure
3793
+ .. _`session.gc_divisor` : https://www.php.net/manual/en/session.configuration.php#ini.session.gc-divisor
3794
+ .. _`session.gc_maxlifetime` : https://www.php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime
3795
+ .. _`session.sid_length` : https://www.php.net/manual/en/session.configuration.php#ini.session.sid-length
3796
+ .. _`session.sid_bits_per_character` : https://www.php.net/manual/en/session.configuration.php#ini.session.sid-bits-per-character
3797
+ .. _`session.save_path` : https://www.php.net/manual/en/session.configuration.php#ini.session.save-path
3798
+ .. _`session.use_cookies` : https://www.php.net/manual/en/session.configuration.php#ini.session.use-cookies
3780
3799
.. _`Microsoft NTLM authentication protocol` : https://docs.microsoft.com/en-us/windows/win32/secauthn/microsoft-ntlm
3781
3800
.. _`utf-8 modifier` : https://www.php.net/reference.pcre.pattern.modifiers
3782
3801
.. _`Link HTTP header` : https://tools.ietf.org/html/rfc5988
0 commit comments