Public Member Functions | |
CI_Session ($params=array()) | |
sess_read () | |
sess_write () | |
sess_create () | |
sess_update () | |
sess_destroy () | |
userdata ($item) | |
all_userdata () | |
set_userdata ($newdata=array(), $newval= '') | |
unset_userdata ($newdata=array()) | |
set_flashdata ($newdata=array(), $newval= '') | |
keep_flashdata ($key) | |
flashdata ($key) | |
_flashdata_mark () | |
_flashdata_sweep () | |
_get_time () | |
_set_cookie ($cookie_data=NULL) | |
_serialize ($data) | |
_unserialize ($data) | |
_sess_gc () | |
Public Attributes | |
$sess_encrypt_cookie = FALSE | |
$sess_use_database = FALSE | |
$sess_table_name = '' | |
$sess_expiration = 7200 | |
$sess_match_ip = FALSE | |
$sess_match_useragent = TRUE | |
$sess_cookie_name = 'ci_session' | |
$cookie_prefix = '' | |
$cookie_path = '' | |
$cookie_domain = '' | |
$sess_time_to_update = 300 | |
$encryption_key = '' | |
$flashdata_key = 'flash' | |
$time_reference = 'time' | |
$gc_probability = 5 | |
$userdata = array() | |
$CI | |
$now |
CI_Session::_flashdata_mark | ( | ) |
CI_Session::_flashdata_sweep | ( | ) |
Removes all flashdata marked as 'old'
private
CI_Session::_get_time | ( | ) |
Get the "now" time
private
CI_Session::_serialize | ( | $ | data | ) |
Serialize an array
This function first converts any slashes found in the array to a temporary marker, so when it gets unserialized the slashes will be preserved
private
array |
CI_Session::_sess_gc | ( | ) |
Garbage collection
This deletes expired session rows from database if the probability percentage is met
public
CI_Session::_set_cookie | ( | $ | cookie_data = NULL |
) |
Write the session cookie
public
CI_Session::_unserialize | ( | $ | data | ) |
Unserialize
This function unserializes a data string, then converts any temporary slash markers back to actual slashes
private
array |
CI_Session::all_userdata | ( | ) |
Fetch all session data
public
CI_Session::CI_Session | ( | $ | params = array() |
) |
Session Constructor
The constructor runs the session routines automatically whenever the class is instantiated.
CI_Session::flashdata | ( | $ | key | ) |
Fetch a specific flashdata item from the session array
public
string |
CI_Session::keep_flashdata | ( | $ | key | ) |
Keeps existing flashdata available to next request.
public
string |
CI_Session::sess_create | ( | ) |
Create a new session
public
CI_Session::sess_destroy | ( | ) |
Destroy the current session
public
CI_Session::sess_read | ( | ) |
Fetch the current session data if it exists
public
CI_Session::sess_update | ( | ) |
Update an existing session
public
CI_Session::sess_write | ( | ) |
Write the session data
public
CI_Session::set_flashdata | ( | $ | newdata = array() , |
|
$ | newval = '' | |||
) |
Add or change flashdata, only available until the next request
public
mixed | ||
string |
CI_Session::set_userdata | ( | $ | newdata = array() , |
|
$ | newval = '' | |||
) |
Add or change data in the "userdata" array
public
mixed | ||
string |
CI_Session::unset_userdata | ( | $ | newdata = array() |
) |
Delete a session variable from the "userdata" array
array
CI_Session::userdata | ( | $ | item | ) |
Fetch a specific item from the session array
public
string |
CI_Session::$CI |
CI_Session::$cookie_domain = '' |
CI_Session::$cookie_path = '' |
CI_Session::$cookie_prefix = '' |
CI_Session::$encryption_key = '' |
CI_Session::$flashdata_key = 'flash' |
CI_Session::$gc_probability = 5 |
CI_Session::$now |
CI_Session::$sess_cookie_name = 'ci_session' |
CI_Session::$sess_encrypt_cookie = FALSE |
CI_Session::$sess_expiration = 7200 |
CI_Session::$sess_match_ip = FALSE |
CI_Session::$sess_match_useragent = TRUE |
CI_Session::$sess_table_name = '' |
CI_Session::$sess_time_to_update = 300 |
CI_Session::$sess_use_database = FALSE |
CI_Session::$time_reference = 'time' |
CI_Session::$userdata = array() |