isLoggedIn Problem |
[eluser]GamingFusion[/eluser]
In my site i am using a simple templating system, where i load one view file and pass a variable to the view that contains what view file to load. When a user is logged in the sidebar changes to accomidate the logged in user with a profiel and logout link. But if you go to any other page the side bar seems to think the user isnt logged in even though they are. The template file loads header.php and footer.php files. the header file contains the sidebar and the the code that check when the user is logged in. here is all of header.php Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> and here is the template file you you dont quite understand Code: <?php $this->load->view('includes/header.php'); ?>
[eluser]bigtony[/eluser]
How are you loading the $isLoggedIn variable? Presumably it's being stored in the session, so you could just check that in your view: Code: <?php if ($this->session->userdata('isLoggedIn')); ?>
[eluser]GamingFusion[/eluser]
yes it is stored in a session. I will try that when i get home. Thanks man
|
Welcome Guest, Not a member yet? Register Sign In |