I'm trying to following a youtube tuts for make a login system on CodeIgniter. I was pretty new on php framework and I choose CI for its semplicity. So I have an array where I need to store session data:
$data = array('email' => $this->input->post('email'),
is_logged_in' => true);
the tutorial use userdata(); function with
$this->session->userdata($data);
but when he try to print de session array do:
print_r($this->session->all_userdata($data));
alluserdata(); is deprecated, so I read the doc, and I found out that userdata is a legacy function. I want to learn what I write so I try to modernize the code to be updated and clean for CI3.
is use userdata(); good for CI3? or I have to use $_SESSION[]? or $this->session?
The problems is that if I try to use
$this->session->data
and than:
print_r($this->session->data);
I have nothing in output. I just want to output data array in session so I can understand if it's working. Thank you in advance
EDIT if i use set_userdata() for set session and just print_r($this->session->userdata()); for print session all I have is:
Array
(
[__ci_last_regenerate] => 1453313633
[email] => [email protected]
[is_logged_in] => 1
)
and not info about browser, time ecc...is that normal?