one out of four session variables lost

From: Date: Tue, 19 Aug 2003 20:15:06 +0000
Subject: one out of four session variables lost
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-160075@lists.php.net to get a copy of this message
$_SESSION['uname'] = $_POST['uname']; $_SESSION['pwd'] = $_POST['pwd'];
When the user first logs in I also adds two more session variables within accesscontrol(): $_SESSION['editor'] = mysql_result($result,0,"u_editor"); $_SESSION['admin'] = mysql_result($result,0,"u_admin"); Both is either an Y or a N. When showing menus, I use these two session variables to decide wether editor and admin menus should be shown to the present user. Like this: include ("schedule.php"); if ($_SESSION['editor'] == "Y") include ("editor.php"); if ($_SESSION['admin'] == "Y") include ("admin.php"); But something strange happens. Sometime, while an user who is both admin and editor is logged in, the $_SESSION['editor'] variable is dropped, causing the editor menu not being shown. A check through all my source code shows that the only instance where I assign is in accesscontrol() shown above. Are there any known circumstances where session variables are lost? (I guess that the answer is no, and this is an error caused by myself, but since I can't find it, I have to ask ;) -- anders thoresson

« previous php.general (#160075) next »