Re: Sessions don't survive redirects...

From: Date: Mon, 19 Jun 2000 14:31:37 +0000
Subject: Re: Sessions don't survive redirects...
Groups: php.version4 
Request: Send a blank email to php-version4+get-16322@lists.php.net to get a copy of this message
> This one is short and sweet. Sessions don't get stored in final, and > i.php shows NULL. I've succesfully used sessions in other situations > with a test script. Am I missing something here? auto_start = 1, > save_handler = files. A session file is created with !referrer in it > but no value. > > August > > redirect.php: > ---- > $REQUEST_URI = getenv("REQUEST_URI"); > $url_array=explode("/", $REQUEST_URI); > session_register("referrer"); > $referrer = $url_array[2]; > header("Location: http://www.cashwars.com/i.php"); > exit(); > i.php > ------ > echo $HTTP_SESSION_VARS["referrer"]; > var_dump($HTTP_SESSION_VARS["referrer"]); I use this approach in redirection session_register('whatever'); $sid = SID; header("Location: http://www.some.url/nextpage.php?$sid"); I think it is necessary even if you compiled with --enable-trans-sid. BTW: --enable-trans-sid is rather broken and makes more trouble than advantage. -- Martin Horak, system programmer North Bohemia Energy s.c. Decin, Czech Republic

« previous php.version4 (#16322) next »