1 <?php
defined('SYSPATH') OR die('No direct access allowed.');
3 * Help class for user session data
8 * Fetch session data for certain variable
10 * @param $var string: Variable name to return value for
11 * @return Value from session on success. false if not found
13 public static function session($var = false)
16 return !empty(Auth
::instance()->get_user()->$var) ? Auth
::instance()->get_user()->$var : false;
17 $user_data = Session
::instance()->get('user_data', false);
18 if (is_object($user_data) && isset($user_data->$var)) {
19 $return = $user_data->$var;
22 $return = Session
::instance()->get($var, false);