feyd | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Ok, the issue is this. Whenever you click on one of the products (after logging in on the homepage), you get logged out when the products page is loaded. The registration page and the submit page load just fine without logging you out. However, they all use the same files to check for logged in / logged out. The product page is somehow killing the $_SESSION. I have tried everything, but it won't work. You can see it all at http://www.tablashirt.com. Feel free to log on with the following:
User: ryan@yahoo.com
PW:ryan
Once you are in, click on a product and see how you get logged out. Please disregard ALL the content on the site as it is just temporary crap I am using to test this structure.
Interestingly enough, once you get auto-logged out, logging in AGAIN and then going to the products results in it working fine.
Here is the code all my pages include that checks if the user is logged in or not and responds accordingly:
Code: Select all
<div id="masthead">
<a href="<?php echo("http://www.tablashirt.com")?>"><img src="<?php echo("$root" . "images/logo.gif")?>" alt="Tablashirt" /></a>
<?php
if(!isset($_SESSION['logged']) || $_SESSION['logged'] !== true) {
echo('<span class="login"><a href="#" onclick="$(\'#ifxElement\').BlindDown(500);return false;">Login</a></span>');
}
else{
echo('<span class="login"><a href=' . $root . 'login/logout.php>Logout</a></span>');
}
include("login/index.php");
?>
<div id="nav">
<ul>
<li><a href="<?php echo"$root" . "submit/"?>">Submit</a></li>
<li><a href="<?php echo"$root" . "score/"?>">Score</a></li>
<li><a href="<?php echo"$root" . "shop/"?>">Shop</a></li>
<li><a href="<?php echo"$root" . "registration/"?>">Join</a></li>
</ul>
</div>
</div>
In order to isolate the issue, I removed EVERYTHING except the the <head> file (which has session_start() in it) and the masthead.php file you see above from the products.php page. It still logs me out. Let me make this perfectly clear to everyone. I have 4 pages (home, submit, registration, and products) that all leverage the same <head> and masthead file shown above. All of them react to the $_SESSION exactly as they should EXCEPT the products page. Bear in mind the fact that if I take ALL the content out of the product page, it still kills the $_SESSION.
Is the name 'products' disallowed for folders or files? I know that sounds nuts, but nothing else makes sense. If you load in content from a db query do you have to handle $_SESSION in a different way? Really, that shouldn't matter as I have removed the query and the page still logs me out.
feyd | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]