Create (Use) SESSION in Codeigniter
Use in Controller
$this->load->library('session');
$id=5;
$this->session->set_userdata('ID',$id);
redirect('dashboard', 'refresh');
if ($this->session->userdata('ID') == TRUE)
{
//do something
redirect('dashboard');
}
else{
//echo 'hello<br>';
}
Comments
Post a Comment