RE: [PHP] Re: session cookies enabled?
| From: | Ford, Mike | Date: | Wed, 09 May 2007 12:18:59 +0000 |
| Subject: | RE: [PHP] Re: session cookies enabled? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-254636@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: ccspencer@softhome.net [mailto:ccspencer@softhome.net]
> Sent: 08 May 2007 20:57
> > You can also set up php.ini and use the built-in sessions with
> > http://php.net/session_start so that PHP will take care of
> > this for
> > you.
>
> That is what I was intending to do. How do I find out if
> whether or not the session cookie was accepted using the
> built-in sessions? I found no function for such a test.
Check the SID constant after you've done session_start(). If it has an
empty value, the session is using cookies; otherwise, it'll have a value
of the form 'sessionname=sessionid', which is what is appended to the
URL (or inserted in forms as a hidden value) to propagate the
session-id.
Cheers!
Mike
------------------------------------------------------------------------
----------------
Mike Ford, Electronic Information Services Adviser,
JG125, The Headingley Library, James Graham Building,
Headingley Campus, Beckett Park, LEEDS, LS6 3QS
United Kingdom
Tel: +44 113 812 4730 Fax: +44 113 812 3211
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm