Frank Rust wrote:

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...

If memory serves, you shouldn't use the $_SESSION variables in the same script that will use session_is_registered. I just checked the online documentation and yep, that's the case. Are you trying to see if a session has been started? See this:


http://www.php.net/manual/en/function.session-start.php

Jason

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to