FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Will this set or get a SESSION variable?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Will this set or get a SESSION variable? [message #180828 is a reply to message #180826] Wed, 20 March 2013 22:53 Go to previous messageGo to previous message
Christoph Becker is currently offline  Christoph Becker
Messages: 91
Registered: June 2012
Karma:
Member
David Heller wrote:

> I have the following code snippet:
>
> if(in_array($name, $this->m_names))
> {
> $this->m_rules[$name][] = $rule;
> return $_SESSION[$name];
>
> }
> In the entire script there does not appear to be any assignment to the
> $_SESSION super global
> so would it be fair to say that "return $_SESSION[$name];" not only
> creates a session variable but returns it also? And what is it set
> to?? It appears to me that $_SESSION[$name] = " " or possibly
> something else.

You may check it out for yourself:

if(in_array($name, $this->m_names))
{
$this->m_rules[$name][] = $rule;
var_dump($_SESSION[$name]);
return $_SESSION[$name];

}

If the session is not initialized or the session variable has not been
set before, it will print NULL.

You'll find comprehensive information about PHP sessions on
<http://www.php.net/manual/en/book.session.php>.

--
Christoph M. Becker
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: APC issues: locking up all processes and lack of PHP 5.4 support
Next Topic: question about class getters
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 04:20:04 GMT 2024

Total time taken to generate the page: 0.04574 seconds