[nycphp-talk] Disappearing $_SESSION variables after using header ()

Tony Furnivall tfurnivall at
Mon Nov 24 21:39:47 EST 2008

Many thanks to  [csnyder] and [Tim Lieberman] for their helpful suggestions
about header ().

I now have that part of things working fine. However, because there is an
implicit exit; after issuing the call to header (), I'm uncertain if the
$_SESSION variables are being set properly.

When I trace them at the end of one page they are all there
($_SESSION['userid'] = $userid; $_SESSION['badgename']=$badgename;), but
when I examine the $_SESSION array at the start of the next page, the
variables do not exist. My guess is that by short-circuiting any nrmal
end-of-script processing, I may be bypassing the write of the $_SESSION
array to the temporary file. This feels like forcing a buffer-flush when
working with low-level disc IO. Is there any known reason for $_SESSION
variables to disappear in such circumstances?

Does anyone have any other ideas?

Thanks for any pointers,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the talk mailing list