How do I check if the browser supports cookies, in javascript? [duplicate]
Especially for the iPhone
This works in IE, Chrome and Safari (which should be the same as iPhone):
if (navigator.cookieEnabled)
alert("ON");
else
alert("OFF");
EDIT: Since nvl decided to take my answer and not check into it I thought I should. Tested it on all the browsers I could find and seems to work just fine.
精彩评论