PHP Session problem...
| From: | Guru P Chaturvedi | Date: | Sun, 04 May 2003 20:51:24 +0000 |
| Subject: | PHP Session problem... | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-19758@lists.php.net to get a copy of this message | ||
hi all,
i'm really really confused and fed up of the PHP sessions. it works
sometimes and fails horribly rest of the times. please take a look at the
code:
Creating session variables: (i am explicitly calling session_start())
$row = mysql_fetch_array($result, MYSQL_BOTH);
$_SESSION["uid"] = trim($row[0]);
$_SESSION["uname"] = trim($row[1]);
header("Location: bohome.php?");
it get's thru very well and get's redirected to bohome.php
if that file i have this peice of code:
session_start();
ob_start();
$userid = trim($_SESSION["uid"]);
$username = trim($_SESSION["uname"]);
if( $userid == "" )
{
header("Location: index.php?msg=err&" . $userid);
exit;
}
here the $userid is becoming "" and thus redirects back to index page. why
is this behaving so... what cud be the problem...? please help me out....
regards,
guru.