mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Merge pull request #7505 from kenjis/fix-docs-session-destroy
docs: improve Session::destroy()
This commit is contained in:
commit
8bcc33ef92
@ -353,16 +353,18 @@ destroy()
|
||||
---------
|
||||
|
||||
To clear the current session (for example, during a logout), you may
|
||||
simply use either PHP's `session_destroy() <https://www.php.net/session_destroy>`_
|
||||
function, or the library's ``destroy()`` method. Both will work in exactly the
|
||||
same way:
|
||||
simply use the library's ``destroy()`` method:
|
||||
|
||||
.. literalinclude:: sessions/037.php
|
||||
|
||||
.. note:: This must be the last session-related operation that you do
|
||||
during the same request. All session data (including flashdata and
|
||||
tempdata) will be destroyed permanently and functions will be
|
||||
unusable during the same request after you destroy the session.
|
||||
This method will work in exactly the same way as PHP's
|
||||
`session_destroy() <https://www.php.net/session_destroy>`_ function.
|
||||
|
||||
This must be the last session-related operation that you do during the same request.
|
||||
All session data (including flashdata and tempdata) will be destroyed permanently.
|
||||
|
||||
.. note:: You do not have to call this method from usual code. Cleanup session
|
||||
data rather than destroying the session.
|
||||
|
||||
.. _session-stop:
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
<?php
|
||||
|
||||
session_destroy();
|
||||
// or
|
||||
$session->destroy();
|
||||
|
Loading…
x
Reference in New Issue
Block a user