session_is_registered gets session values only after doing some output first !?
| From: | Frank Rust | Date: | Wed, 23 Jun 2004 10:11:11 +0000 |
| Subject: | session_is_registered gets session values only after doing some output first !? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-188860@lists.php.net to get a copy of this message | ||
I try to check if a session is registered. This works fine if
I first do some output
echo "abc";
if (!session_is_registered('userid')) { do_something(); }
else { redirect_to_somewhere(); }
and I can't redirect to another page ...
If I comment out the echo statement I get always false and
$_SESSION is empty, but I could redirect somewhere...
I tried php 4.3.1 and 4.3.7 with apache 2.0.45 both the same.
On a Windows box the same program runs fine.
Can anybody help?
_________________________________________________________________________
Frank Rust, Technische Universität, Institut für Theoretische Informatik
Tel.: +49 531 391 9525 Postfach 3329, D-38023 Braunschweig
Fax.: +49 531 391 9529 Mühlenpfordtstr. 22-23, D-38106 Braunschweig