Jump to content

[SOLVED] How Can I Detect if a User's Cookies are Disabled?


Fluoresce

Recommended Posts

Yes. Make a cookie. Then see if that cookie exists. If not, he has it disabled. If so, he has it enabled. You are welcome.  :D

 

Great!

 

So it can be done.

 

I'm guessing that it has to be done with PHP. Do you know of any scripts that I can refer to?

Link to comment
Share on other sites

I'm guessing that it has to be done with PHP.

 

You don't have to use PHP, almost any web programming/scripting language should have the ability to manipulate cookies, including JavaScript. Of course if they have cookies disabled, I would have thought they'd more like the kind of user to have JS disabled as well.

 

In addition to that tutorial you may want to take a look at the PHP manual for setcookie, for a more thorough explanation.

Link to comment
Share on other sites

That would create an infinite loop, in the case that cookies are not set, unless you also include a get param that you check.  To redirect is no different than any other type of redirect -- you have the http header location method or a meta refresh.  As for getting the current page, there's the really helpful $_SERVER['PHP_SELF'].

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.