Skip to content

CI_Session

Mathieu Nayrolles edited this page Jan 20, 2016 · 1 revision

CI_Session

CodeIgniter Session Class

  • Class name: CI_Session
  • Namespace:

Properties

$userdata

public mixed $userdata

Userdata array

Just a reference to $_SESSION, for BC purposes.

  • Visibility: public

$_driver

protected mixed $_driver = 'files'
  • Visibility: protected

$_config

protected mixed $_config
  • Visibility: protected

Methods

__construct

void CI_Session::__construct(array $params)

Class constructor

  • Visibility: public

Arguments

  • $params array - <p>Configuration parameters</p>

_ci_load_classes

string CI_Session::_ci_load_classes(string $driver)

CI Load Classes

An internal method to load all possible dependency and extension classes. It kind of emulates the CI_Driver library, but is self-sufficient.

  • Visibility: protected

Arguments

  • $driver string - <p>Driver name</p>

_configure

void CI_Session::_configure($params)

Configuration

Handle input parameters and configuration defaults

  • Visibility: protected

Arguments

  • $params mixed

_ci_init_vars

void CI_Session::_ci_init_vars()

Handle temporary variables

Clears old "flash" data, marks the new one for deletion and handles "temp" data deletion.

  • Visibility: protected

mark_as_flash

boolean CI_Session::mark_as_flash(mixed $key)

Mark as flash

  • Visibility: public

Arguments

  • $key mixed - <p>Session data key(s)</p>

get_flash_keys

array CI_Session::get_flash_keys()

Get flash keys

  • Visibility: public

unmark_flash

void CI_Session::unmark_flash(mixed $key)

Unmark flash

  • Visibility: public

Arguments

  • $key mixed - <p>Session data key(s)</p>

mark_as_temp

boolean CI_Session::mark_as_temp(mixed $key, integer $ttl)

Mark as temp

  • Visibility: public

Arguments

  • $key mixed - <p>Session data key(s)</p>
  • $ttl integer - <p>Time-to-live in seconds</p>

get_temp_keys

array CI_Session::get_temp_keys()

Get temp keys

  • Visibility: public

unmark_temp

void CI_Session::unmark_temp(mixed $key)

Unmark flash

  • Visibility: public

Arguments

  • $key mixed - <p>Session data key(s)</p>

__get

mixed CI_Session::__get(string $key)

__get()

  • Visibility: public

Arguments

  • $key string - <p>'session_id' or a session data key</p>

__set

void CI_Session::__set(string $key, mixed $value)

__set()

  • Visibility: public

Arguments

  • $key string - <p>Session data key</p>
  • $value mixed - <p>Session data value</p>

sess_destroy

void CI_Session::sess_destroy()

Session destroy

Legacy CI_Session compatibility method

  • Visibility: public

sess_regenerate

void CI_Session::sess_regenerate(boolean $destroy)

Session regenerate

Legacy CI_Session compatibility method

  • Visibility: public

Arguments

  • $destroy boolean - <p>Destroy old session data flag</p>

get_userdata

mixed CI_Session::get_userdata()

Get userdata reference

Legacy CI_Session compatibility method

  • Visibility: public

userdata

mixed CI_Session::userdata(string $key)

Userdata (fetch)

Legacy CI_Session compatibility method

  • Visibility: public

Arguments

  • $key string - <p>Session data key</p>

set_userdata

void CI_Session::set_userdata(mixed $data, mixed $value)

Set userdata

Legacy CI_Session compatibility method

  • Visibility: public

Arguments

  • $data mixed - <p>Session data key or an associative array</p>
  • $value mixed - <p>Value to store</p>

unset_userdata

void CI_Session::unset_userdata($key)

Unset userdata

Legacy CI_Session compatibility method

  • Visibility: public

Arguments

  • $key mixed

all_userdata

array CI_Session::all_userdata()

All userdata (fetch)

Legacy CI_Session compatibility method

  • Visibility: public

has_userdata

boolean CI_Session::has_userdata(string $key)

Has userdata

Legacy CI_Session compatibility method

  • Visibility: public

Arguments

  • $key string - <p>Session data key</p>

flashdata

mixed CI_Session::flashdata(string $key)

Flashdata (fetch)

Legacy CI_Session compatibility method

  • Visibility: public

Arguments

  • $key string - <p>Session data key</p>

set_flashdata

void CI_Session::set_flashdata(mixed $data, mixed $value)

Set flashdata

Legacy CI_Session compatibility method

  • Visibility: public

Arguments

  • $data mixed - <p>Session data key or an associative array</p>
  • $value mixed - <p>Value to store</p>

keep_flashdata

void CI_Session::keep_flashdata(mixed $key)

Keep flashdata

Legacy CI_Session compatibility method

  • Visibility: public

Arguments

  • $key mixed - <p>Session data key(s)</p>

tempdata

mixed CI_Session::tempdata(string $key)

Temp data (fetch)

Legacy CI_Session compatibility method

  • Visibility: public

Arguments

  • $key string - <p>Session data key</p>

set_tempdata

void CI_Session::set_tempdata(mixed $data, mixed $value, integer $ttl)

Set tempdata

Legacy CI_Session compatibility method

  • Visibility: public

Arguments

  • $data mixed - <p>Session data key or an associative array of items</p>
  • $value mixed - <p>Value to store</p>
  • $ttl integer - <p>Time-to-live in seconds</p>

unset_tempdata

void CI_Session::unset_tempdata($key)

Unset tempdata

Legacy CI_Session compatibility method

  • Visibility: public

Arguments

  • $key mixed
Clone this wiki locally