• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with session class !!

#1
[eluser]alsemany[/eluser]
this code for the log in script

Code:
if ($login == true)
{
$newdata = array(
                   'username'  => $row->username,
                   'email'     => $row->email,
     'logged_in' => TRUE
               );


$this->session->set_userdata($newdata);


}

I suppose that the session have been saved
but if I open any page after this with the code

Quote: print_r ($this->session->userdata);


this generate a new session with an empty user_data
like this
Quote:Array ( [session_id] => dcdfdefc19734ea8941e6d7075df0b99 [ip_address] => 41.XXX.XXX.XX [user_agent] => Mozilla/5.0 (X11; Linux i686; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 [last_activity] => 1326691863 [user_data] => ) 

how can I check if the user logged or not wheather the session data is not saved !!
I'm not understanding this class well , I hope someone help me to understand this point.



Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.