Reputation: 51
I've been watching this tuts from yt how to build login system with Codeigniter
when guy from video put this code to get user data
<?php print_r ($this->session->all_userdata ());?>
he gets array with all data like in this video. I receive array like this
Array( [__ci_last_regenerate] => 1467913653)
So when try to login it always redirect me to restricted area even when email and password are good, and all should work.
Is it problem because I use Codeigniter 3, in video is CI 2?
Upvotes: 2
Views: 1152
Reputation: 7966
make sure that session library is loaded you can auto load it from config/autoload.php as follows
$config['libraries'] = array('session');
or load it in controller constructor as follows
$this->load->library('session');
and then you can get session data by call this method
$this->session->userdata();
I hope my answer would be useful
Upvotes: 5