RE: [PHP] I don't understand HTTP_SESSION_VARS
| From: | Johnson, Kirk | Date: | Fri, 23 Mar 2001 23:20:40 +0000 |
| Subject: | RE: [PHP] I don't understand HTTP_SESSION_VARS | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-45362@lists.php.net to get a copy of this message | ||
Mike, my experiments suggest you can also get rid of the session_register()
statement. Seems that simply assigning to $HTTP_SESSION_VARS[my_session_var]
is enough.
Kirk
> -----Original Message-----
> From: Michael Champagne [mailto:mchampagne@capis.com]
> Subject: RE: [PHP] I don't understand HTTP_SESSION_VARS
>
>
> YES! That's what it was. You rule man. Why would
> session_start need to come
> before the global variable declaration? You'd think
> session_start would need
> $HTTP_SESSION_VARS declared beforehand to load the session
> variables into?
>
> Thanks,
> Mike
>
> > OK, try this. The session_start() has to come before the
> global statement:
> >
> > <?php
> > function write_session()
> > {
> > session_start();
> > global $HTTP_SESSION_VARS;
> > $HTTP_SESSION_VARS[my_session_var] = "Boogedy Boogedy";
> > session_register($HTTP_SESSION_VARS["my_session_var"]);
> > }
> >
> > write_session();
> > echo $HTTP_SESSION_VARS['my_session_var'];
> > ?>