Docs For Class DB_Session

## DB_Session

Description

Session Class

- author: Dready
- link: http://dready.jexiste.fr/dotclear/index.php?2006/09/13/19-reworked-session-handler-for-code-igniter

Located in /libraries/DB_Session.php (line 16)

Variable Summary
mixed $cookie_sent
mixed $encryption
mixed $flash_key
mixed $gc_probability
mixed $now
mixed $object
mixed $session_table
mixed $sess_cookie
mixed $sess_length
mixed $userdata
mixed $use_database
Method Summary
DB_Session DB_Session ()
void flashdata ( $key)
void keep_flashdata ( $key)
void sess_create ()
void sess_destroy ()
void sess_gc ()
void sess_read ()
void sess_run ()
void sess_send_cookie ([boolean $force = FALSE])
void sess_update ()
void set_flashdata ( $key, $value)
void set_userdata ([mixed $newdata = array()], [string $newval = ''])
void unset_userdata ([ $newdata = array()])
string userdata ([string $item = ''])
void _flashdata_mark ()
void _flashdata_sweep ()
Variables
mixed $cookie_sent = FALSE (line 26)
mixed $encryption = TRUE (line 19)
mixed $flash_key = 'flash' (line 28)
mixed $gc_probability = 5 (line 25)
mixed $now (line 18)
mixed $object (line 27)
mixed $session_table = FALSE (line 21)
mixed $sess_cookie = 'ci_session' (line 23)
mixed $sess_length = 7200 (line 22)
mixed $userdata = array() (line 24)
mixed $use_database = FALSE (line 20)
Methods
Constructor DB_Session (line 37)

Session Constructor

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

DB_Session DB_Session ()
flashdata (line 453)

Returns "flash" data for the given key.

void flashdata ( $key)

- $key

keep_flashdata (line 441)

Keeps existing "flash" data available to next request.

void keep_flashdata ( $key)

- $key

sess_create (line 257)

Create a new session

- access: public

void sess_create ()
sess_destroy (line 315)

Destroy the current session

- access: public

void sess_destroy ()
sess_gc (line 339)

Garbage collection

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

- access: public

void sess_gc ()
sess_read (line 161)

Fetch the current session data if it exists

- access: public

void sess_read ()
sess_run (line 53)

Run the session routines

- access: public

void sess_run ()
sess_send_cookie (line 233)

Write the session cookie

- access: public

void sess_send_cookie ([boolean $force = FALSE])

- boolean $force: true if we want to send cookie even if a cookie has already been sent

sess_update (line 287)

Update an existing session

- access: public

void sess_update ()
set_flashdata (line 432)

Sets "flash" data which will be available only in next request (then it will be deleted from session). You can use it to implement "Save succeeded" messages after redirect.

void set_flashdata ( $key, $value)

- $key
- $value

set_userdata (line 380)

Add or change data in the "userdata" array

- access: public

void set_userdata ([mixed $newdata = array()], [string $newval = ''])

- mixed $newdata
- string $newval

unset_userdata (line 407)

Delete a session variable from the "userdata" array

void unset_userdata ([ $newdata = array()])

- $newdata

userdata (line 363)

Fetch a specific item form the session array

- access: public

string userdata ([string $item = ''])

- string $item

_flashdata_mark (line 462)

PRIVATE: Internal method - marks "flash" session attributes as 'old'

void _flashdata_mark ()
_flashdata_sweep (line 480)

PRIVATE: Internal method - removes "flash" session marked as 'old'

void _flashdata_sweep ()

Documentation generated on Mon, 15 Sep 2008 12:57:44 +0100 by phpDocumentor 1.4.2