CodeIgniter Forums
using is_logged_in() function - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: using is_logged_in() function (/showthread.php?tid=49036)



using is_logged_in() function - El Forum - 02-06-2012

[eluser]Unknown[/eluser]
hello all, i m new with codeigniter, and trying to create a social netwoking website just to understand mode about codeigniter. Thus i've created a is_logged_in() and want to use it with more than once controller, how should i use it whether to use it with autoload() function or create a basecontroller for this, which is more efficient way.



using is_logged_in() function - El Forum - 02-07-2012

[eluser]TWP Marketing[/eluser]
The base controller is the better way to handle this.


using is_logged_in() function - El Forum - 03-09-2012

[eluser]Vaibhav132[/eluser]
Use this..
if ($this->session->userdata('is_logged_in') == TRUE) {
load this view;
} else {
load this view;
}