![]() |
Help with SESSION. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html) +--- Thread: Help with SESSION. (/thread-52274.html) |
Help with SESSION. - El Forum - 06-04-2012 [eluser]Yakow[/eluser] Hello dudes! Im new in CI, so i have a basic question and need help. is the basic login system, so, in my home.php i put this code: Code: function login(){ When i print "print_r($this->session->all_userdata());" i can recive $newdata... So when i go another controller "produtos", i have this code: Code: function __construct(){ So, when i print print_r($this->session->all_userdata()); i can't get the information came from $newdata in home controller, and i can't get the view. Why ?? Sorr for my english. Help with SESSION. - El Forum - 06-04-2012 [eluser]Cristian Gilè[/eluser] If you want to check if the user is logged in, you have to use userdata not set_userdata: Code: if(!$this->session->userdata('loggedin')) Help with SESSION. - El Forum - 06-04-2012 [eluser]Yakow[/eluser] Cristian now i put userdata('... and when i do print_r, return me this: Code: Array ( [session_id] => 4368e98a1a2811b9cdc627ed70613673 [ip_address] => 127.0.0.1 [user_agent] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 [last_activity] => 1338828074 [user_data] => ) look the empty user_data Help with SESSION. - El Forum - 06-04-2012 [eluser]Cristian Gilè[/eluser] Post the session settings of the config file. Help with SESSION. - El Forum - 06-04-2012 [eluser]Yakow[/eluser] i put the default config, now its working ![]() So ty so much and sorry for my newbie question!! |