Skip to content

Commit 9defe6d

Browse files
committed
docs: add a note for confusing behavior
1 parent 16c21cc commit 9defe6d

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

user_guide_src/source/helpers/cookie_helper.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ The following functions are available:
6969
.. literalinclude:: cookie_helper/002.php
7070

7171
This function is otherwise identical to ``set_cookie()``, except that it
72-
does not have the ``value`` and ``expire`` parameters. You can submit an
72+
does not have the ``value`` and ``expire`` parameters.
73+
74+
.. note:: When you use ``set_cookie()``,
75+
if the ``value`` is set to empty string and the ``expire`` is set to ``0``, the cookie will be deleted.
76+
If the ``value`` is set to non-empty string and the ``expire`` is set to ``0``, the cookie will only last as long as the browser is open.
77+
78+
You can submit an
7379
array of values in the first parameter or you can set discrete
7480
parameters.
7581

user_guide_src/source/outgoing/response.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,9 @@ The methods provided by the parent class that are available are:
394394
from *now* that you wish the cookie to be valid. If the ``expire`` is
395395
set to zero the cookie will only last as long as the browser is open.
396396

397+
.. note:: But if the ``value`` is set to empty string and the ``expire`` is set to ``0``,
398+
the cookie will be deleted.
399+
397400
For site-wide cookies regardless of how your site is requested, add your
398401
URL to the ``domain`` starting with a period, like this:
399402
.your-domain.com

0 commit comments

Comments
 (0)