Re: SID set or unset?
| From: | Curt Zirzow | Date: | Wed, 10 Sep 2003 04:39:21 +0000 |
| Subject: | Re: SID set or unset? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-162139@lists.php.net to get a copy of this message | ||
* Thus wrote Jean-Christian IMbeault (jc@mega-bucks.co.jp):
> Is the PHP constant SID always defined? I have found conflicting answer
> in the documentation. One page of the docs says it is always defined
> while another says it is defined only if the right cookie hasn't been
> passed to the server.
>
> Also how can I check if the SID is set or not?
>
> I have tried the following but get an error:
>
> <?php
> if (isset(SID)) {}
> ?>
> Parse error: parse error, expecting
T_VARIABLE' or
> '$''
SID is a constant, only variables can be tested with isset().
http://php.net/isset
What you want is defined()
http://php.net/defined
ie:
if (defined('SID')) {}
Curt
--
"I used to think I was indecisive, but now I'm not so sure."