Re: session/header problem (warning:newbie with sessions)
| From: | Comex | Date: | Sat, 17 May 2003 22:14:35 +0000 |
| Subject: | Re: session/header problem (warning:newbie with sessions) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148055@lists.php.net to get a copy of this message | ||
Ryan A wrote:
> Thanks guys but now have a new problem with sessions that has been
> driving me nuts for over an hour.
>
> heres my code (this is the second page):
> ******************************************************
> <?php
> session_start();
> header("Cache-control: private"); //IE 6 Fix
> error_reporting (E_ALL);
> include_once("configbwh.php");
>
>
> if(session_is_registered('user')){
> echo "The session is still registered.";
> } else {
> header("Location: co.details.php");
> exit;
> }
>>
> <? if(isset($_SESSION['user']))
> {
> echo $_SESSION['user'];
> }
> else
> {print("asdf");}
>>
> blah<? echo $_SESSION['pass']; ?>blah
> *******************************************************
>
> the above always outputs :
> The session is still registered.asdfblahblah
>
> and never the "user" or "pass"
>
> Please help.
>
> Thanks,
> -Ryan
AFAIK, session_is_registered checks session_register, which doesn't have
anything to do with $_SESSION. session_register works sorta like
register_globals.. when you session_register a variable, it stays the same.
But you use $var not $_SESSION['var'].
1.41421356237309504880168872420969807856967187537694
It's true that it's not true, not taking into consideration the fact
that could not be not true, or perhaps the opposite, or perhaps not.
The search is more profitable than the find.
Never, ever back down.
The e-mail given is a spam trap.
..==// Why not? \\==..