My Project
 All Data Structures Namespaces Functions Variables
Public Member Functions | Data Fields
CI_Session Class Reference

Public Member Functions

 __construct ($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 ()
 

Data Fields

 $sess_encrypt_cookie = FALSE
 
 $sess_use_database = FALSE
 
 $sess_table_name = ''
 
 $sess_expiration = 7200
 
 $sess_expire_on_close = FALSE
 
 $sess_match_ip = FALSE
 
 $sess_match_useragent = TRUE
 
 $sess_cookie_name = 'ci_session'
 
 $cookie_prefix = ''
 
 $cookie_path = ''
 
 $cookie_domain = ''
 
 $cookie_secure = FALSE
 
 $sess_time_to_update = 300
 
 $encryption_key = ''
 
 $flashdata_key = 'flash'
 
 $time_reference = 'time'
 
 $gc_probability = 5
 
 $userdata = array()
 
 $CI
 
 $now
 

Constructor & Destructor Documentation

__construct (   $params = array())

Session Constructor

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

Member Function Documentation

_flashdata_mark ( )

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

private

Returns
void
_flashdata_sweep ( )

Removes all flashdata marked as 'old'

private

Returns
void
_get_time ( )

Get the "now" time

private

Returns
string
_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

Parameters
array
Returns
string
_sess_gc ( )

Garbage collection

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

public

Returns
void
_set_cookie (   $cookie_data = NULL)

Write the session cookie

public

Returns
void
_unserialize (   $data)

Unserialize

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

private

Parameters
array
Returns
string
all_userdata ( )

Fetch all session data

public

Returns
array
flashdata (   $key)

Fetch a specific flashdata item from the session array

public

Parameters
string
Returns
string
keep_flashdata (   $key)

Keeps existing flashdata available to next request.

public

Parameters
string
Returns
void
sess_create ( )

Create a new session

public

Returns
void
sess_destroy ( )

Destroy the current session

public

Returns
void
sess_read ( )

Fetch the current session data if it exists

public

Returns
bool
sess_update ( )

Update an existing session

public

Returns
void
sess_write ( )

Write the session data

public

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

Add or change flashdata, only available until the next request

public

Parameters
mixed
string
Returns
void
set_userdata (   $newdata = array(),
  $newval = '' 
)

Add or change data in the "userdata" array

public

Parameters
mixed
string
Returns
void
unset_userdata (   $newdata = array())

Delete a session variable from the "userdata" array

array

Returns
void
userdata (   $item)

Fetch a specific item from the session array

public

Parameters
string
Returns
string

The documentation for this class was generated from the following file: