Re: HTTP_SESSION_VARS]
| From: | Andrey Hristov | Date: | Thu, 08 Nov 2001 17:45:55 +0000 |
| Subject: | Re: HTTP_SESSION_VARS] | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73924@lists.php.net to get a copy of this message | ||
Not very sure but give a try :
call session_write_close() (PHP>=4.0.4) before redirecting.
Also its better to do
$username = $HTTP_SESSION_VARS['username'];
instead of
$username = $HTTP_SESSION_VARS[username];
Because the latter generates warnigs(commonly suppressed by error_reporting())
----- Original Message -----
From: "Ron Clark" <clarkron@mail.armstrong.edu>
To: <php-general@lists.php.net>
Sent: Thursday, November 08, 2001 7:37 PM
Subject: Re: [PHP] HTTP_SESSION_VARS]
> Andrey Hristov wrote:
> >
> > Can you place a snippet of your code? Remove the things which are confidential.
> >
> > Andrey Hristov
> > IcyGEN Corporation
> > http://www.icygen.com
> > BALANCED SOLUTIONS
>
>
> In file called by the login form.
>
> session_start();
> session_register('usertype');
> session_register('username');
>
> This file redirects the user to user.php where
> session_start();
> $username = $HTTP_SESSION_VARS[username];
> print "username $username";
> only prints the string username
> print_r($HTTP_SESSION_VARS);
> only prints Array()
>
> Looking at the session files:
> If register_globals is off-
>
> !username|!usertype|
>
> If register_globals is on-
> |b:1;username|s:8:"clarkron"|usertype|s:7:"Faculty";user_is_logged_in
>
> Ron Clark
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>