Re: How to tell if client has cookies turned off?

From: Date: Tue, 06 Mar 2001 17:23:24 +0000
Subject: Re: How to tell if client has cookies turned off?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-42778@lists.php.net to get a copy of this message
Something else to consider is that if someone is kinda smart they can place the variable into the url. So, if it is important you may want to put a checksum or token in there. Rick At 08:52 AM 3/6/01 -0800, you wrote:
On 6 Mar 2001 07:53:46 -0800, kevin1 <kevin1@outcomemail.com> wrote: How can I tell reliably if someone has cookies turned off? Set a cookie on your site (perhaps the homepage?) and use code like this:
        if (!empty($UserHasCookies)) {
                echo 'Whew - you do have cookies';
        }
The idea is to set your code to assume that cookie support is disabled unless it finds a cookie saying otherwise. That way it'll fail safely if someone either doesn't have a cookie or their browser discards the cookie halfway through. This may seem silly, but some people get *really* paranoid about cookies. Combined with the increasingly good cookie management in modern browsers and just about anything is possible - this is in fact the major shortcoming to code like the above - it's possible for someone to accept one cookie and deny another, so just being able to set a cookie once does not mean that you will be able to set another. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
########################################################## # Rick St Jean, # rstjean@internet.look.ca # President of Design Shark, # http://www.designshark.com/ # Quick Contact: http://www.designshark.com/messaging.ihtml # Tel: 905-684-2952 ##########################################################

« previous php.general (#42778) next »