Skip to content

Commit def9351

Browse files
committed
docs: update docs
1 parent cd61c4c commit def9351

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

user_guide_src/source/changelogs/v4.5.0.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ Interface Changes
5757
or implemented these interfaces, all these changes are backward compatible
5858
and require no intervention.
5959

60+
- **ResponseInterface:** The default value of the third parameter ``$expire`` of
61+
the ``ResponseInterface::setCookie()`` has been fixed from ``''`` to ``0``.
6062
- **Logger:** The `psr/log <https://packagist.org/packages/psr/log>`_ package has
6163
been upgraded to v2.0.0.
6264

@@ -65,6 +67,15 @@ Interface Changes
6567
Method Signature Changes
6668
========================
6769

70+
Setting Cookies
71+
---------------
72+
73+
The third parameter ``$expire`` in :php:func:`set_cookie()` and
74+
:php:meth:`CodeIgniter\\HTTP\\Response::setCookie()` has been fixed.
75+
76+
The type has been changed from ``string`` to ``int``, and the default value has
77+
been changed from ``''`` to ``0``.
78+
6879
FileLocatorInterface
6980
--------------------
7081

user_guide_src/source/helpers/cookie_helper.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Available Functions
2121

2222
The following functions are available:
2323

24-
.. php:function:: set_cookie($name[, $value = ''[, $expire = ''[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = false[, $httpOnly = false[, $sameSite = '']]]]]]]])
24+
.. php:function:: set_cookie($name[, $value = ''[, $expire = 0[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = false[, $httpOnly = false[, $sameSite = '']]]]]]]])
2525
2626
:param array|Cookie|string $name: Cookie name *or* associative array of all of the parameters available to this function *or* an instance of ``CodeIgniter\Cookie\Cookie``
2727
:param string $value: Cookie value

user_guide_src/source/outgoing/response.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ The methods provided by the parent class that are available are:
453453
followed by the response body. For the main application response, you do not need to call
454454
this as it is handled automatically by CodeIgniter.
455455

456-
.. php:method:: setCookie($name = ''[, $value = ''[, $expire = ''[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = false[, $httponly = false[, $samesite = null]]]]]]]])
456+
.. php:method:: setCookie($name = ''[, $value = ''[, $expire = 0[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = false[, $httponly = false[, $samesite = null]]]]]]]])
457457
458458
:param array|Cookie|string $name: Cookie name *or* associative array of all of the parameters available to this method *or* an instance of ``CodeIgniter\Cookie\Cookie``
459459
:param string $value: Cookie value
@@ -481,7 +481,7 @@ The methods provided by the parent class that are available are:
481481
.. literalinclude:: response/023.php
482482

483483
Only the ``name`` and ``value`` are required. To delete a cookie set it with the
484-
``expire`` blank.
484+
``value`` blank.
485485

486486
The ``expire`` is set in **seconds**, which will be added to the current
487487
time. Do not include the time, but rather only the number of seconds

user_guide_src/source/outgoing/response/023.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
$cookie = [
44
'name' => 'The Cookie Name',
55
'value' => 'The Value',
6-
'expire' => '86500',
6+
'expire' => 86500,
77
'domain' => '.some-domain.com',
88
'path' => '/',
99
'prefix' => 'myprefix_',

0 commit comments

Comments
 (0)