I am using codeigniter 2.1.0.
I am trying to execute the register / login function using the session library in the source code.
The register / login in the session library worked fine for the local host, but when I put it on the air and tried, the session did not work.
My controller login works this way. I check my credentials as soon as I set up my session data and redirect to another page.
$user_data = array(
'username' => $result->user_name,
'email' => $result->user_email,
'userid' => $result->user_id,
'role' => $result->user_role,
'login_state' => TRUE,
'lastlogin' => time(),
);
$this->session->set_userdata($user_data);
print_r( $this->session->all_userdata());
redirect(base_url('dashboard'));
here, when I print all my session data, they print. But on the controller side of the panel, when I try to print session data, they were no longer there.
Any idea why? Thank you in advance.
source
share