![]() |
How to check if the user is logged in. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: How to check if the user is logged in. (/showthread.php?tid=51252) |
How to check if the user is logged in. - El Forum - 04-26-2012 [eluser]Cinghius[/eluser] I am writing to know how to check if the user has logged in or not, before doing the redirect on the home page, and display other content than the home page as not logged in. thank you so much How to check if the user is logged in. - El Forum - 04-26-2012 [eluser]WanWizard[/eluser] That greatly depends on the mechanism used for authentication and authorisation, so there isn't one single answer. How to check if the user is logged in. - El Forum - 04-26-2012 [eluser]Cinghius[/eluser] I have a controller through a login function and various methods to check whether the user can log in, or not. In the end, does a redirect on the home page. I would know, if the user who is logged on the homepage, sees things other than not logged. To do this, I would have to work on the method $ this-> tank_auth-> is_logged_in () How to check if the user is logged in. - El Forum - 04-26-2012 [eluser]WanWizard[/eluser] I'm not familiar with tank_auth, but I assume is has a method to check if a user is logged on or not? A quick check of the library shows that is indeed is_logged_in(), so if you know that, what is your question? How to check if the user is logged in. - El Forum - 04-26-2012 [eluser]Cinghius[/eluser] Code: if ($this->tank_auth->is_logged_in()) { // logged in What I write on the home page after the redirect to check if the user is logged in, how do I make the control of that method? I apologize if I have not explained well How to check if the user is logged in. - El Forum - 04-26-2012 [eluser]WanWizard[/eluser] This doesn't really explain much, other than it's pretty useless to load a view and then redirect... How to check if the user is logged in. - El Forum - 04-26-2012 [eluser]cPage[/eluser] Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |