Properties

$sess_encrypt_cookie

$sess_encrypt_cookie : 

Type

$sess_use_database

$sess_use_database : 

Type

$sess_table_name

$sess_table_name : 

Type

$sess_expiration

$sess_expiration : 

Type

$sess_expire_on_close

$sess_expire_on_close : 

Type

$sess_match_ip

$sess_match_ip : 

Type

$sess_match_useragent

$sess_match_useragent : 

Type

$sess_cookie_name

$sess_cookie_name : 

Type

$cookie_prefix

$cookie_prefix : 

Type

$cookie_path

$cookie_path : 

Type

$cookie_domain

$cookie_domain : 

Type

$cookie_secure

$cookie_secure : 

Type

$sess_time_to_update

$sess_time_to_update : 

Type

$encryption_key

$encryption_key : 

Type

$flashdata_key

$flashdata_key : 

Type

$time_reference

$time_reference : 

Type

$gc_probability

$gc_probability : 

Type

$userdata

$userdata : 

Type

$CI

$CI : 

Type

$now

$now : 

Type

Methods

__construct()

__construct(  $params = array()) 

Session Constructor

The constructor runs the session routines automatically whenever the class is instantiated.

Parameters

$params

sess_read()

sess_read() : boolean

Fetch the current session data if it exists

Returns

boolean

sess_write()

sess_write() : void

Write the session data

sess_create()

sess_create() : void

Create a new session

sess_update()

sess_update() : void

Update an existing session

sess_destroy()

sess_destroy() : void

Destroy the current session

userdata()

userdata(  $item) : string

Fetch a specific item from the session array

Parameters

$item

Returns

string

all_userdata()

all_userdata() : array

Fetch all session data

Returns

array

set_userdata()

set_userdata(  $newdata = array(),   $newval = '') : void

Add or change data in the "userdata" array

Parameters

$newdata
$newval

unset_userdata()

unset_userdata(  $newdata = array()) : void

Delete a session variable from the "userdata" array

Parameters

$newdata

set_flashdata()

set_flashdata(  $newdata = array(),   $newval = '') : void

Add or change flashdata, only available until the next request

Parameters

$newdata
$newval

keep_flashdata()

keep_flashdata(  $key) : void

Keeps existing flashdata available to next request.

Parameters

$key

flashdata()

flashdata(  $key) : string

Fetch a specific flashdata item from the session array

Parameters

$key

Returns

string

_flashdata_mark()

_flashdata_mark() : void

Identifies flashdata as 'old' for removal when _flashdata_sweep() runs.

_flashdata_sweep()

_flashdata_sweep() : void

Removes all flashdata marked as 'old'

_get_time()

_get_time() : string

Get the "now" time

Returns

string

_set_cookie()

_set_cookie(  $cookie_data = NULL) : void

Write the session cookie

Parameters

$cookie_data

_serialize()

_serialize(  $data) : string

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

Parameters

$data

Returns

string

_unserialize()

_unserialize(  $data) : string

Unserialize

This function unserializes a data string, then converts any temporary slash markers back to actual slashes

Parameters

$data

Returns

string

_sess_gc()

_sess_gc() : void

Garbage collection

This deletes expired session rows from database if the probability percentage is met