4 * CodeIgniter style sessions.
8 class Auth_Yadis_CISession extends Auth_Yadis_PHPSession {
12 public function __construct()
14 $this->ci =& get_instance();
15 $this->ci->load->library('session');
19 * Set a session key/value pair.
21 * @param string $name The name of the session key to add.
22 * @param string $value The value to add to the session.
24 function set($name, $value)
26 $this->ci->session->set_userdata($name, $value);
30 * Get a key's value from the session.
32 * @param string $name The name of the key to retrieve.
33 * @param string $default The optional value to return if the key
34 * is not found in the session.
35 * @return string $result The key's value in the session or
36 * $default if it isn't found.
38 function get($name, $default=NULL)
40 $value = $this->ci->session->userdata($name);
52 * Remove a key/value pair from the session.
54 * @param string $name The name of the key to remove.
58 $this->ci->session->unset_userdata($name);
62 * Return the contents of the session in array form.
66 return $this->ci->session->all_userdata();