how do I know if cookies are enabled?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • windandwaves

    how do I know if cookies are enabled?

    Hi Gurus

    What is the most reliable and efficient way to find out if the user has
    cookies enabled? I know this is a really stupid question, but I can't seem
    to work it out.







  • Joshie Surber

    #2
    Re: how do I know if cookies are enabled?

    While I would first suggest that you design your pages where cookies
    aren't required, the simplest way would be to include a small cookie
    (hascookies=tru e, for example) on index.php then send a redirect header
    to index2.php (or whatever) that checks for the existence of the
    hascookies cookie. Then just design your site around index2.php instead
    of index.php.

    (if that seems sloppy, you could set the defaultindex in apache to
    cookietest.php or something then redirect to index.php)

    Hope that works for you.

    Comment

    • Geoff Berrow

      #3
      Re: how do I know if cookies are enabled?

      I noticed that Message-ID: <O5j0f.15851$iM 2.1296673@news. xtra.co.nz>
      from windandwaves contained the following:
      [color=blue]
      >
      >What is the most reliable and efficient way to find out if the user has
      >cookies enabled? I know this is a really stupid question, but I can't seem
      >to work it out.[/color]


      The thing is, its a two hit deal. When the user visits your page your
      page can set a cookie on the users machine. But you only get to find
      out if the cookie was set on the next server call, when the cookie is
      sent back.
      --
      Geoff Berrow (put thecat out to email)
      It's only Usenet, no one dies.
      My opinions, not the committee's, mine.
      Simple RFDs http://www.ckdog.co.uk/rfdmaker/

      Comment

      Working...