CI_Session::unmark_flash()

unmark_flash($key) Parameters: $key (mixed) – Key to be un-marked as flashdata, or an array of multiple keys Return type: void Unmarks a $_SESSION item key (or multiple ones) as “flashdata”.

CI_Session::tempdata()

tempdata([$key = NULL]) Parameters: $key (mixed) – Tempdata item key or NULL Returns: Value of the specified item key, or an array of all tempdata Return type: mixed Gets the value for a specific $_SESSION item that has been marked as “tempdata”, or an array of all “tempdata” items if no key was specified. Note This is a legacy method kept only for backwards compatibility with older applications. You should directly access $_SESSION instead.

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::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::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::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::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::flashdata()

flashdata([$key = NULL]) Parameters: $key (mixed) – Flashdata item key or NULL Returns: Value of the specified item key, or an array of all flashdata Return type: mixed Gets the value for a specific $_SESSION item that has been marked as “flashdata”, or an array of all “flashdata” items if no key was specified. Note This is a legacy method kept only for backwards compatibility with older applications. You should directly access $_SESSION instead.

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::all_userdata()

all_userdata() Returns: An array of all userdata Return type: array Returns an array containing all “userdata” items. Note This method is DEPRECATED. Use userdata() with no parameters instead.