On Friday 31 May 2002 10:53 am, David Eisenhart wrote:
> Hi
>
> I am writing a function to construct page links within my site; I want it
> to append the session id to the URL's query string if the client does not
> accept cookies (and ignore the session id if the client does accept
> cookies).
>
> How do I detect if the client browser accepts cookies?
> Indeed, has anyone got such a function as described above?

Here's one approach you could try.  Set a cookie, send a redirect, and see if 
you get the cookie back ...

Script 1 - cookiecheck1.php

<?php
setcookie("testcookie","ok");
header("Location: cookiecheck2.php");
?>

Script 2  - cookiecheck2.php

<?php
if ($testcookie =="ok")
  print "This browser appears to handle cookies OK.";
else
  print "This browser either doesn't support use of cookies, 
    or has cookie use disabled.";
?>

Regards

- Nick


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

Reply via email to