RE: [PHP] PHP Sessions
| From: | Ford, Mike [LSS] | Date: | Wed, 04 Dec 2002 14:25:28 +0000 |
| Subject: | RE: [PHP] PHP Sessions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-126983@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Justin French [mailto:justin@indent.com.au]
> Sent: 04 December 2002 14:15
>
> Good point -- are the included files functions, or other stuff??
>
> function myfunc()
> {
> return $_SESSION['something'];
> }
>
> will not work, but:
Oh, yes it will! -- $_SESSION is, after all, a *superglobal*!
Now, this won't work:
function myfunc()
{
return $HTTP_SESSION_VARS['something'];
}
And nor will this (assuming register_globals=On):
function myfunc()
{
return $my_session_var;
}
-- both of these need an appropriate global statement, or use of the $GLOBALS array.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211