Strange session id problem - code is issuing a new one randomly

From: Date: Thu, 15 Aug 2002 01:34:01 +0000
Subject: Strange session id problem - code is issuing a new one randomly
Groups: php.general 
Request: Send a blank email to php-general+get-112642@lists.php.net to get a copy of this message
# START CODE SNIPPET ... COMMENTS BELOW (and yes I am not a db guru by anymeans, might be easier ways to do this) <?php session_start(); $tsid=session_id(); echo $tsig; # <--------debug $date=date("ymdHi"); $connect=mysql_pconnect('localhost', 'user', 'pass'); mysql_select_db('db', $connect); $queryexe=mysql_query("SELECT user, ip, dtg FROM tmp WHERE sid='$tsid'"); $row=mysql_fetch_array($queryexe); extract($row); $id=''; $status=''; mysql_select_db('a_db', $connect); $queryexe=mysql_query("SELECT site, camp FROM users WHERE user='$user'"); $row=mysql_fetch_array($queryexe); extract($row); mysql_select_db('cbs_tech', $connect); extract($_GET); extract($_POST); switch ($site){ case 'cbs': switch ($_SERVER['REQUEST_METHOD']){ case 'POST': switch ($user){ case 'allenr': break; default: switch ($status){ case 1: $queryexe=mysql_query("SELECT event FROM log WHERE id=$id"); $row=mysql_fetch_array($queryexe); extract($row); $queryexe=mysql_query("UPDATE log SET event='$event' WHERE id=$id"); header('Location: https://example.org'); die; } break; Now this is where I have issues. The header ('Location: https://example.org') works as it is suppose to BUT!!! a new SID is issued. Thought the SID stayed w/ the browser until it was closed. When I loop back through I of course can not find the previous SID as a new one was created. Is it because I am going POST-->GET (seems to work with GET-->GET or GET-->POST) Any ideas why a new one is being created? (and don't say start_session() ... this is a long script and the ONLY place it has issues is when I am processing a $POST (works fine for all the $GETS)) Thank in advance, -Peter ################################## Peter Thoenen - Systems Programmer Commercial Communications Camp Bondsteel, Kosovo ##################################

« previous php.general (#112642) next »