At 17:52 28.02.2003, Don spoke out and said:
--------------------[snip]--------------------
>I have a site that requires a user to login in for extended function.  The
>site uses sessions.  I note that if a user configures his/her browser block
>all cookies, he/she will not be able to navigate the extended part of the
>site.  Is there a way (PHP code if possible please) to verify if session
>cookies are enabled in the user's browser?
--------------------[snip]-------------------- 

First of all, if you have URL rewriting enabled (it is by default) any site
should be transparently working regardless of the client's cookie settings,
as far as sessions are concerned.

That said - you can use the SID constant. SID contains either
"PHPSESSIONID=###" if cookies are _DIS_abled, or is empty if cookies are
_EN_abled:

    if (empty(SID))
        // ok, go ahead
    else
        // issue a warning here

Of course this only works after the first response of the client to the
site where sessions are enabled. The SID will always contain the session
key after starting the session for the very first time, thus the above code
will always trigger the warning.


-- 
   >O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
    ^ http://www.vogelsinger.at/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to