CI_Session::set_userdata()

set_userdata($data[, $value = NULL]) Parameters: $data (mixed) – An array of key/value pairs to set as session data, or the key for a single item $value (mixed) – The value to set for a specific session item, if $data is a key Return type: void Assigns data to the $_SESSION superglobal. Note This is a legacy method kept only for backwards compatibility with older applications.

CI_Session::set_tempdata()

set_tempdata($data[, $value = NULL]) Parameters: $data (mixed) – An array of key/value pairs to set as tempdata, or the key for a single item $value (mixed) – The value to set for a specific session item, if $data is a key $ttl (int) – Time-to-live value for the tempdata item(s), in seconds Return type: void Assigns data to the $_SESSION superglobal and marks it as “tempdata”. Note This is a legacy method kept only for backwards compatibility with older applications.

CI_Session::set_flashdata()

set_flashdata($data[, $value = NULL]) Parameters: $data (mixed) – An array of key/value pairs to set as flashdata, or the key for a single item $value (mixed) – The value to set for a specific session item, if $data is a key Return type: void Assigns data to the $_SESSION superglobal and marks it as “flashdata”. Note This is a legacy method kept only for backwards compatibility with older applications.

CI_Session::sess_regenerate()

sess_regenerate([$destroy = FALSE]) Parameters: $destroy (bool) – Whether to destroy session data Return type: void Regenerate session ID, optionally destroying the current session’s data. Note This method is just an alias for PHP’s native session_regenerate_id() function.

CI_Session::sess_destroy()

sess_destroy() Return type: void Destroys the current session. Note This must be the last session-related function that you call. All session data will be lost after you do that. Note This method is just an alias for PHP’s native session_destroy() function.

CI_Session::mark_as_temp()

mark_as_temp($key[, $ttl = 300]) Parameters: $key (mixed) – Key to mark as tempdata, or an array of multiple keys $ttl (int) – Time-to-live value for the tempdata, in seconds Returns: TRUE on success, FALSE on failure Return type: bool Marks a $_SESSION item key (or multiple ones) as “tempdata”.

CI_Session::mark_as_flash()

mark_as_flash($key) Parameters: $key (mixed) – Key to mark as flashdata, or an array of multiple keys Returns: TRUE on success, FALSE on failure Return type: bool Marks a $_SESSION item key (or multiple ones) as “flashdata”.

CI_Session::keep_flashdata()

keep_flashdata($key) Parameters: $key (mixed) – Flashdata key to keep, or an array of multiple keys Returns: TRUE on success, FALSE on failure Return type: bool Retains the specified session data key(s) as “flashdata” through the next request. Note This is a legacy method kept only for backwards compatibility with older applications. It is just an alias for the mark_as_flash() method.

CI_Session::has_userdata()

has_userdata($key) Parameters: $key (string) – Session item key Returns: TRUE if the specified key exists, FALSE if not Return type: bool Checks if an item exists in $_SESSION. Note This is a legacy method kept only for backwards compatibility with older applications. It is just an alias for isset($_SESSION[$key]) - please use that instead.

CI_Session::get_temp_keys()

get_temp_keys() Returns: Array containing the keys of all “tempdata” items. Return type: array Gets a list of all $_SESSION that have been marked as “tempdata”.