Welcome Guest, Not a member yet? Register   Sign In
Need help reducing database requests to check if a user is logged in
#8

[eluser]BrianDHall[/eluser]
You can define a constant, which is available in all scopes but can't be changed once set.

You can define a class variable in your MY_Controller (so it's available in all controllers) which defaults to false but your login functions could set it to true. This would be done in a model/library as:

Code:
$ci =& get_instance();
$ci->logged_in = true;

In a controller you'd just use $this->logged_in.

Or you could just use the super-global $GLOBALS array.


Messages In This Thread
Need help reducing database requests to check if a user is logged in - by El Forum - 12-26-2009, 03:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB