Skip to content

Commit 8bcc33e

Browse files
authored
Merge pull request #7505 from kenjis/fix-docs-session-destroy
docs: improve Session::destroy()
2 parents 311d66e + cba7713 commit 8bcc33e

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

user_guide_src/source/libraries/sessions.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,16 +353,18 @@ destroy()
353353
---------
354354

355355
To clear the current session (for example, during a logout), you may
356-
simply use either PHP's `session_destroy() <https://www.php.net/session_destroy>`_
357-
function, or the library's ``destroy()`` method. Both will work in exactly the
358-
same way:
356+
simply use the library's ``destroy()`` method:
359357

360358
.. literalinclude:: sessions/037.php
361359

362-
.. note:: This must be the last session-related operation that you do
363-
during the same request. All session data (including flashdata and
364-
tempdata) will be destroyed permanently and functions will be
365-
unusable during the same request after you destroy the session.
360+
This method will work in exactly the same way as PHP's
361+
`session_destroy() <https://www.php.net/session_destroy>`_ function.
362+
363+
This must be the last session-related operation that you do during the same request.
364+
All session data (including flashdata and tempdata) will be destroyed permanently.
365+
366+
.. note:: You do not have to call this method from usual code. Cleanup session
367+
data rather than destroying the session.
366368

367369
.. _session-stop:
368370

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
<?php
22

3-
session_destroy();
4-
// or
53
$session->destroy();

0 commit comments

Comments
 (0)