php - Access Session data in codeigniter -


 $username = $this->input->post('username'); $password = $this->input->post('password'); $result = $this->accountmodel->login($username,$password); if($result){ foreach($result $row){ $loggedin = array('admin_name' => $row['username'], 'is_loggedin' => true); $this->session->set_userdata($loggedin); 

how able access ['admin_name'] , ['is_loggedin'] without having run code , running foreach loop $this->session->all_userdata()

from "retrieving session data" section of session class docs:

any piece of information session array available using following function:

$this->session->userdata('item');

so want:

$this->session->userdata('admin_name'); 

the docs friend ;)


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -