CodeIgniter Forums

Full Version: Ion Auth - logout problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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.

El Forum

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

El Forum

[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');
}

El Forum

[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;

El Forum

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

El Forum

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