Articles → PHP CODEIGNITER → Sessions In Codeigniter

Sessions In Codeigniter






Purpose





How To Set Session Key?




$this->load->library('session');

$this->session->set_userdata(array(
        'key1'  => ‘value1’,
        ‘Key2’ =>  ‘value2’));



How To Get The Value Of The Session?




$this->load->library('session');
$this->session->userdata('keyname');



How To Unset A Session?




$this->load->library('session');
$this->session->unset_userdata('keyname');



Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, August 11, 2020

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250