[UPHPU] login session propagation problems

Steve Dibb steve at wonkabar.org
Thu May 11 09:32:35 MDT 2006


Scott Hill wrote:

> On 5/11/06, Dave Simpson <bigbikkuri at gmail.com> wrote:
> ...
>
> CHECKLOGIN.PHP
>
>> _________________
>>
>>     session_start();
>>         //check to make sure the session variable is registered
>>     if(session_is_registered('$user'))
>>     {
>
>
>
> Why not use isset?  I've never used session_is_registered and I've 
> never had
> a problem.
> Check out  http://www.php.net/session_is_registered .
>
You can be even more lazy than that.  You could just do 
if($_SESSION['var']) and it will return true / false if it's set.  It 
might throw a PHP Notice though.  I can't remember.

For good, readable code though, you should use isset.

And what does session_is_registered() do?  Sets 'global' variables?  Huh?

Steve


More information about the UPHPU mailing list