Re: session cookies enabled?

From: Date: Wed, 09 May 2007 15:36:16 +0000
Subject: Re: session cookies enabled?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-254657@lists.php.net to get a copy of this message
Ford, Mike writes:
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.
Interesting idea. This brings up a question. In order to decide whether to use cookies or SID the built-in sessions must be testing to see if the user's browser will accept the session cookies. How do they do that? If they do it by the "2 page", send a cookie and see if it comes back to the second page method we have been talking about, then somehow, they are sureptiously inserting a forward to a non- existant page! Right? How do they do that? Best, Craig ------------------------------------------------------
-     Virtual Phonecards - Instant Pin by Email      -
-           Large Selection - Great Rates            -
-     http://speedypin.com/?aff=743&co_branded=1     -
------------------------------------------------------ 
**************************************
*                                    *
*          Craig Spencer             *
*      ccspencer@SoftHome.net        *
*                                    *
************************************** 


« previous php.general (#254657) next »