On 10 September 2003 04:42, Jean-Christian IMbeault contributed these pearls of wisdom:
> 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. H'mm, yes, the wording could be tidies up a little. SID is always defined if there is a session active -- however, it will be defined to be the empty string if the correct cookie is passed. This way, you can unconditionally use SID, without needing to check whether it exists, in appropriate places. > 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 `'$'' isset() only works on variables, and SID is a constant -- use defined() instead. But, as I've pointed out above, you shouldn't really ever have a need to do this. Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php