I have my index page and then a separate directory for the admin panel. Whenever I go from admin panel to the index, the first time I open the browser, the session changes and logs the user out. If I log back in, the session stays when I repeat the same task. I setup a session header that displays the sessions at the top of the page and the session changes when this error occurs.
Here is some coding that will hopefully assist:
TOP OF ADMIN.PHP
CODE
<?php
include('sessions.php');
include('allowadmin.php');
include('header.php'); ?>
HEADER.PHP IN ADMIN DIRECTORY
CODE
<div id='navbar' align='middle'>
<ul>
Logged in as <?= $_SESSION['user_name'];?>
<a href="http://www.mysite.com/">Home</a>
<a href="admin.php">Admin</a>
</ul>
</div>
SESSIONS.PHP
CODE
<?php
session_start();
echo session_id();
?>
The sessions.php is included in all pages on the site so the session_start() is included on all pages.
This post has been edited by UmmmmIdk: 7 Oct, 2008 - 03:04 PM