CodeIgniter Forums
Ion Auth - logout problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Ion Auth - logout problem (/showthread.php?tid=52756)



Ion Auth - logout problem - El Forum - 06-25-2012

[eluser]kacyvu[/eluser]
Hi all,

I do not know if I am missing something, but when I create new user and log in with new users credentials and try to retrieve users details I get administrators info which I used before to log in. As well when I log myself out I still can see users info. For logging out I use:
Code:
$this->ion_auth->logout();
.
Do I need somehow add some extra code to kill session or what ? Thanks a lot.


Ion Auth - logout problem - El Forum - 06-25-2012

[eluser]solid9[/eluser]
I think the logout() has destroy session.


Ion Auth - logout problem - El Forum - 06-25-2012

[eluser]Jason Hamilton-Mascioli[/eluser]
Make sure to add this to the top of your protected/secure controller page...

if (!$this->ion_auth->logged_in())
{
redirect('auth/login');
}


Ion Auth - logout problem - El Forum - 06-25-2012

[eluser]kacyvu[/eluser]
Guys,

Should this one get current logged in user email ? Or first row user email in DB ?
Code:
$user = $this->ion_auth->user()->row();
  echo $user->email;



Ion Auth - logout problem - El Forum - 06-25-2012

[eluser]Matalina[/eluser]
with out an id it will get the current logged in user.


Ion Auth - logout problem - El Forum - 06-25-2012

[eluser]kacyvu[/eluser]
ok I found my mistake thanks for everyone