From 4f95353d295455ee740aec7ee1b5060195bff987 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 10 Sep 2007 16:37:12 +0000 Subject: fixed docs for unset_userdata() --- user_guide/libraries/sessions.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'user_guide/libraries') 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

Removing Session Data

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:

$this->session->unset_userdata('some_name');

-

This function can also be passed an array of items to unset.

-

$array_items = array('username', 'email');
+

This function can also be passed an associative array of items to unset.

+

$array_items = array('username' => '', 'email' => '');

-$this->session->set_userdata($array_items);

+$this->session->unset_userdata($array_items);

Flashdata

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").

Note: Flash variables are prefaced with "flash_" so avoid this prefix in your own session names.

-- cgit v1.2.3-24-g4f1b