Re: I don't understand HTTP_SESSION_VARS
| From: | hi | Date: | Fri, 23 Mar 2001 21:39:59 +0000 |
| Subject: | Re: I don't understand HTTP_SESSION_VARS | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45344@lists.php.net to get a copy of this message | ||
Hi,
That code causes php to crash. I have never had that happen before. Every
time I try to run that script, I am given an internal server warning.
""Johnson, Kirk"" <kjohnson@zootweb.com> wrote in message
news:01A4B59FD1EBD311838100A0C98BE0D9AD582E@chef.zootweb.com...
> Try as below. Note both the global and the session_register statements.
>
> > function set session()
> > {
> > global $my_session_var,$HTTP_SESSION_VARS;
> > session_start();
> > $my_session_var = "Blah blah";
> > session_register($HTTP_SESSION_VARS['my_session_var']);
> > }
>
> Kirk
>
>
> > -----Original Message-----
> > From: Michael Champagne [mailto:mchampagne@capis.com]
> > Sent: Friday, March 23, 2001 1:32 PM
> > To: PHP General Mailing List
> > Subject: [PHP] I don't understand HTTP_SESSION_VARS
> >
> >
> > I'm still having problems with this. I was able to get
> > sessions and session
> > variables working ok with register_globals=on, but I had read
> > that it was
> > better not to keep register_globals on so I turned it off and
> > I'm trying to
> > figure out how this works now.
> >
> > I'm registering a variable in one function say like this:
> > function set session()
> > {
> > global $my_session_var;
> > session_start();
> > $my_session_var = "Blah blah";
> > session_register('my_session_var');
> > }
> >
> > Then I'm trying to read it in another function like this:
> > function read_session()
> > {
> > global $HTTP_SESSION_VARS;
> > session_start();
> > echo ($HTTP_SESSION_VARS[my_session_var]);
> > }
>
> > Michael Champagne, Software Engineer
>
> --
> 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
>