@@ -1589,29 +1589,31 @@ You can also :ref:`store sessions in a database <session-database>`.
1589
1589
name
1590
1590
....
1591
1591
1592
- **type **: ``string `` **default **: ``null ``
1592
+ **type **: ``string ``
1593
+
1594
+ This specifies the name of the session cookie.
1593
1595
1594
- This specifies the name of the session cookie. By default, it will use the
1595
- cookie name which is defined in the ``php.ini `` with the ``session.name ``
1596
- directive.
1596
+ If not set, ``php.ini ``'s ``session.name `` directive will be used.
1597
1597
1598
1598
cookie_lifetime
1599
1599
...............
1600
1600
1601
- **type **: ``integer `` ** default **: `` null ``
1601
+ **type **: ``integer ``
1602
1602
1603
- This determines the lifetime of the session - in seconds. The default value
1604
- - ``null `` - means that the ``session.cookie_lifetime `` value from ``php.ini ``
1605
- will be used. Setting this value to ``0 `` means the cookie is valid for
1603
+ This determines the lifetime of the session - in seconds.
1604
+ Setting this value to ``0 `` means the cookie is valid for
1606
1605
the length of the browser session.
1607
1606
1607
+ If not set, ``php.ini ``'s ``session.cookie_lifetime `` directive will be used.
1608
+
1608
1609
cookie_path
1609
1610
...........
1610
1611
1611
- **type **: ``string `` **default **: ``/ ``
1612
+ **type **: ``string ``
1613
+
1614
+ This determines the path to set in the session cookie.
1612
1615
1613
- This determines the path to set in the session cookie. By default, it will
1614
- use ``/ ``.
1616
+ If not set, ``php.ini ``'s ``session.cookie_path `` directive will be used.
1615
1617
1616
1618
cache_limiter
1617
1619
.............
@@ -1660,16 +1662,16 @@ Unlike the other session options, ``cache_limiter`` is set as a regular
1660
1662
cookie_domain
1661
1663
.............
1662
1664
1663
- **type **: ``string `` **default **: ``'' ``
1665
+ **type **: ``string ``
1666
+
1667
+ This determines the domain to set in the session cookie.
1664
1668
1665
- This determines the domain to set in the session cookie. By default, it's
1666
- blank, meaning the host name of the server which generated the cookie according
1667
- to the cookie specification.
1669
+ If not set, ``php.ini ``'s ``session.cookie_domain `` directive will be used.
1668
1670
1669
1671
cookie_samesite
1670
1672
...............
1671
1673
1672
- **type **: ``string `` or ``null `` **default **: ``'lax' ``
1674
+ **type **: ``string `` or ``null `` **default **: ``null ``
1673
1675
1674
1676
It controls the way cookies are sent when the HTTP request did not originate
1675
1677
from the same domain that is associated with the cookies. Setting this option is
@@ -1683,8 +1685,7 @@ those cookies when making that HTTP request.
1683
1685
1684
1686
The possible values for this option are:
1685
1687
1686
- * ``null ``, use it to disable this protection. Same behavior as in older Symfony
1687
- versions.
1688
+ * ``null ``, use ``php.ini ``'s ``session.cookie_samesite `` directive.
1688
1689
* ``'none' `` (or the ``Symfony\Component\HttpFoundation\Cookie::SAMESITE_NONE `` constant), use it to allow
1689
1690
sending of cookies when the HTTP request originated from a different domain
1690
1691
(previously this was the default behavior of null, but in newer browsers ``'lax' ``
@@ -1698,18 +1699,20 @@ The possible values for this option are:
1698
1699
1699
1700
.. note ::
1700
1701
1701
- This option is available starting from PHP 7.3, but Symfony has a polyfill
1702
- so you can use it with any older PHP version as well.
1702
+ Same-site cookies are a PHP 7.3 feature , but Symfony has a polyfill
1703
+ so you can set this option with any older PHP version as well.
1703
1704
1704
1705
cookie_secure
1705
1706
.............
1706
1707
1707
- **type **: ``boolean `` or ``'auto' `` ** default **: `` 'auto' ``
1708
+ **type **: ``boolean `` or ``'auto' ``
1708
1709
1709
1710
This determines whether cookies should only be sent over secure connections. In
1710
1711
addition to ``true `` and ``false ``, there's a special ``'auto' `` value that
1711
1712
means ``true `` for HTTPS requests and ``false `` for HTTP requests.
1712
1713
1714
+ If not set, ``php.ini ``'s ``session.cookie_secure `` directive will be used.
1715
+
1713
1716
cookie_httponly
1714
1717
...............
1715
1718
@@ -1723,10 +1726,12 @@ identity theft through XSS attacks.
1723
1726
gc_divisor
1724
1727
..........
1725
1728
1726
- **type **: ``integer `` ** default **: `` 100 ``
1729
+ **type **: ``integer ``
1727
1730
1728
1731
See `gc_probability `_.
1729
1732
1733
+ If not set, ``php.ini ``'s ``session.gc_divisor `` directive will be used.
1734
+
1730
1735
gc_probability
1731
1736
..............
1732
1737
@@ -1740,45 +1745,46 @@ chance that the GC process will start on each request.
1740
1745
gc_maxlifetime
1741
1746
..............
1742
1747
1743
- **type **: ``integer `` ** default **: `` 1440 ``
1748
+ **type **: ``integer ``
1744
1749
1745
1750
This determines the number of seconds after which data will be seen as "garbage"
1746
1751
and potentially cleaned up. Garbage collection may occur during session
1747
1752
start and depends on `gc_divisor `_ and `gc_probability `_.
1748
1753
1754
+ If not set, ``php.ini ``'s ``session.gc_maxlifetime `` directive will be used.
1755
+
1749
1756
sid_length
1750
1757
..........
1751
1758
1752
- **type **: ``integer `` ** default **: `` 32 ``
1759
+ **type **: ``integer ``
1753
1760
1754
1761
This determines the length of session ID string, which can be an integer between
1755
- ``22 `` and ``256 `` (both inclusive), being ``32 `` the recommended value. Longer
1762
+ ``22 `` and ``256 `` (both inclusive), ``32 `` being the recommended value. Longer
1756
1763
session IDs are harder to guess.
1757
1764
1758
- This option is related to the ` session.sid_length PHP option `_ .
1765
+ If not set, `` php.ini ``'s `` session.sid_length `` directive will be used .
1759
1766
1760
1767
sid_bits_per_character
1761
1768
......................
1762
1769
1763
- **type **: ``integer `` ** default **: `` 4 ``
1770
+ **type **: ``integer ``
1764
1771
1765
1772
This determines the number of bits in the encoded session ID character. The possible
1766
1773
values are ``4 `` (0-9, a-f), ``5 `` (0-9, a-v), and ``6 `` (0-9, a-z, A-Z, "-", ",").
1767
1774
The more bits results in stronger session ID. ``5 `` is recommended value for
1768
1775
most environments.
1769
1776
1770
- This option is related to the ` session.sid_bits_per_character PHP option `_ .
1777
+ If not set, `` php.ini ``'s `` session.sid_bits_per_character `` directive will be used .
1771
1778
1772
1779
save_path
1773
1780
.........
1774
1781
1775
- **type **: ``string `` **default **: ``%kernel.cache_dir%/sessions ``
1782
+ **type **: ``string `` or `` null `` **default **: ``%kernel.cache_dir%/sessions ``
1776
1783
1777
1784
This determines the argument to be passed to the save handler. If you choose
1778
1785
the default file handler, this is the path where the session files are created.
1779
1786
1780
- You can also set this value to the ``save_path `` of your ``php.ini `` by
1781
- setting the value to ``null ``:
1787
+ If ``null ``, ``php.ini ``'s ``session.save_path `` directive will be used:
1782
1788
1783
1789
.. configuration-block ::
1784
1790
@@ -1873,11 +1879,12 @@ Whether to enable the session support in the framework.
1873
1879
use_cookies
1874
1880
...........
1875
1881
1876
- **type **: ``boolean `` ** default **: `` null ``
1882
+ **type **: ``boolean ``
1877
1883
1878
1884
This specifies if the session ID is stored on the client side using cookies or
1879
- not. By default, it will use the value defined in the ``php.ini `` with the
1880
- ``session.use_cookies `` directive.
1885
+ not.
1886
+
1887
+ If not set, ``php.ini ``'s ``session.use_cookies `` directive will be used.
1881
1888
1882
1889
assets
1883
1890
~~~~~~
@@ -3628,8 +3635,6 @@ use the configuration of the first exception that matches ``instanceof``:
3628
3635
.. _`json_encode flags bitmask` : https://www.php.net/json_encode
3629
3636
.. _`error_reporting PHP option` : https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting
3630
3637
.. _`CSRF security attacks` : https://en.wikipedia.org/wiki/Cross-site_request_forgery
3631
- .. _`session.sid_length PHP option` : https://www.php.net/manual/session.configuration.php#ini.session.sid-length
3632
- .. _`session.sid_bits_per_character PHP option` : https://www.php.net/manual/session.configuration.php#ini.session.sid-bits-per-character
3633
3638
.. _`X-Robots-Tag HTTP header` : https://developers.google.com/search/reference/robots_meta_tag
3634
3639
.. _`RFC 3986` : https://www.ietf.org/rfc/rfc3986.txt
3635
3640
.. _`default_socket_timeout` : https://www.php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout
0 commit comments