Re: Checking if cookies can be set.
| From: | James Atkinson | Date: | Fri, 25 Aug 2000 23:22:25 +0000 |
| Subject: | Re: Checking if cookies can be set. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13759@lists.php.net to get a copy of this message | ||
Thanks Jeremy,
Thats pretty much what I figured, but I was hoping I could save myself a
setcookie(), guess not :)
On Fri, 25 Aug 2000, jeremy brand wrote:
> Hi James,
>
> To be tecnical, all browsers accept cookies (they are just
> HTTP headers that you are sending), but here is _an_ answer.
>
> You can set a "test_cookie",
>
> for example, set_cookie('test_cookie','ok');
>
> then on the next page, test to see if $test_cookie == 'ok';
>
> You can also test HTTP_USER_AGENTS for browsers that you want to send
> cookies to, but that doesn't insure that they haven't turned off the
> ability to store, send back cookie informations.
>
> So, setting a test cookie and then testing for it is the best way that
> I have found so far. It is (AFAIKT) the only 100% way of knowing for
> sure.
>
> -jeremy brand
> _______________________________________________________________________
> GnuPG Fingerprint: 9F5E 95E0 1CC2 E054 84EA 6099 8ACD 9DBA D2C0 5EA9
> _ http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for
> more __
>
--
James Atkinson
-----------------------------------------------------------------
James Atkinson 100world
Technical Developer 512-1529 West 6th Avenue
phone: +1-604-637-8122 Vancouver, BC, V6J 1R1
fax: +1-604-742-1770 Canada
email: james.atkinson@100world.com http://www.100world.com
+---------------------------------------------------------------+
| This message may contain confidential and/or privileged |
| information. If you are not the addressee or authorized to |
| receive this for the addressee, you must not use, copy, |
| discolse or take any action based on this message or any |
| information herein. If you have received this message in |
| error, please advise the sender immediately by reply e-mail |
| and delete this message. Thank you for you cooperation |
+---------------------------------------------------------------+