Re: PHP session variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Aug 9, 2012, at 5:16 PM, Jim Lucas <lists@xxxxxxxxx> wrote:
> You are relying on PHP's loose typing.  This is a poor check.
> 
> session_id() returns a string, not boolean.
> 
> You should do this instead.
> 
> if ( session_id() === '' )
> ....
> 
> 
> -- 
> Jim Lucas

Thanks Jim -- you're right.

What about?

if (!defined(SID))
	{
	session_start();
	}


Cheers,

tedd

_____________________
tedd@xxxxxxxxxxxx
http://sperling.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux