Re: PHP session variables
| From: | Tedd Sperling | Date: | Fri, 10 Aug 2012 15:45:15 +0000 |
| Subject: | Re: PHP session variables | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-318668@lists.php.net to get a copy of this message | ||
On Aug 9, 2012, at 5:16 PM, Jim Lucas <lists@cmsws.com> 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@sperling.com
http://sperling.com