Re: Sessions don't survive redirects...

[email protected] ("Martin Horak") Mon, 19 Jun 2000 14:33:37 +0002
Newsgroups php.version4
Organization SCE a.s.
Message-ID <[email protected]>
> 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