Update existing session array variable in CodeIgniter

If you want to change one or two data then need to load old session variable and add new value as per your need.

$userData    =   $this->session->userdata('frontend'); // old session array
$userData['theme']= $this->input->post('theme'); // new value
$this->session->set_userdata('frontend', $userData);

Comments

Popular posts from this blog

Creating Protected routes in ReactJS

Redirect http to https in codeigniter