Session Disappear |
I set the session variable but it disappears. $data in setsession function is a result of a query (row_array).
I have seen this site linked below and I am using SlimBrowser (Chrome copy) in Windows Localhost. Is there a change in this situation stated in the page? I started CI a few days ago now I am planning to never use it again??? I have been trying to understand how a session disappears and gave hours on that... http://billpatrianakos.me/blog/2013/03/2...-problems/ setting function: PHP Code: public function setsession($data){ Checking function: PHP Code: public function isloggedin() I would be grateful if someone can help.
First of all you should make sure you've loaded the session library/driver.
So, if you didn't autoload it, you can load it inside the two functions. Now... if you have CI 2.x... you can load it with PHP Code: $this->load->library('session'); If you have CI 3.dev you can load it with PHP Code: $this->load->driver('session'); Worth mentioning... if setsession() method is called from the controller and not from browser you should make the function (method) private... Website: http://avenir.ro
set_session method is in model. and I have already included session in model and controller.
Still session variable disappears.
|
Welcome Guest, Not a member yet? Register Sign In |