How to unset session variable in codeigniter?
How to unset session variable in codeigniter?
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
You must login to ask question.
You must login to add post.
Aviance School is one of the largest web solutions platform in India for developers to learn and share their programming knowledge and build their careers.
How to unset session variable in codeigniter?
Get session data:
$this->session->userdata('USERID');
To add custom session data:
$session_data = array('USERID' =>"11",'USERNAME' =>"AVIANCE",'PASSWORD' =>"12345");
$this->session->set_userdata($session_data); // $session_data is an associative array of a USER information
To remove all session data:
$this->session->unset_userdata('USERID'); // Removing values from session