How can I use client-side JavaScript to check if a browser accepts cookies?

Ravi Verelly

First write a Cookie:
document.cookie = "TestCookie";

Then check for it:
if (document.cookie.indexOf("TestCookie") == -1) alert("Cookies not accepted");

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact