diff options
Diffstat (limited to 'user_guide/libraries/sessions.html')
-rw-r--r-- | user_guide/libraries/sessions.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 22d46e665..94eb3ca8f 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -176,10 +176,10 @@ encryption process in particular produces a longer data string than the original <h2>Removing Session Data</h2>
<p>Just as set_userdata() can be used to add information into a session, unset_userdata() can be used to remove it, by passing the session key. For example, if you wanted to remove 'some_name' from your session information: </p>
<p><code>$this->session->unset_userdata('some_name');</code></p>
-<p>This function can also be passed an array of items to unset.</p>
-<p><code>$array_items = array('username', 'email');<br />
+<p>This function can also be passed an associative array of items to unset.</p>
+<p><code>$array_items = array('username' => '', 'email' => '');<br />
<br />
-$this->session->set_userdata(<samp>$array_items</samp>);</code></p>
+$this->session->unset_userdata(<samp>$array_items</samp>);</code></p>
<h2>Flashdata</h2>
<p>CodeIgniter supports "flashdata", or session data that will only ba available for the next server request, and are then automatically cleared. These can be very useful, and are typically used for informational or status messages (for example: "record 2 deleted").</p>
<p>Note: Flash variables are prefaced with "flash_" so avoid this prefix in your own session names.</p>
|