|
Posted by d on 09/26/55 11:37
"lwoods" <larry@lwoods.com> wrote in message
news:RPqzf.8953$JT.6285@fed1read06...
>I am trying to pass some info to another page on my site. I set
>"session_start()" in page 1, assign a session variable to a value, then
>execute a "header('Location: ....')." But on the target page I don't get
>any session variable values! BTW, I used a relative location in the
>Location header, not an absolute URL. The behavior looks like it started
>another session, but it should not have.
>
> Ideas?
Before the header("location: "), call session_write_close().
That gave me some serious headaches with mac-based browsers hanging.
Terrible stuff :)
Oh, and you should always use absolute URLs with location. Relative ones do
work, but that's not guaranteed. You could make a function like this to
take care of that for you:
function bounce($url) {
if (sustr($url, 0, 1)=="/") $url="http://".$_SERVER["HTTP_HOST"].$url;
session_write_close();
header("Location: ".$url);
exit();
}
or just use that one :-P
> TIA,
>
> Larry Woods
>
Navigation:
[Reply to this message]
|