javascript - why cookies are always disabled in IE 10 -
i using
navigator.cookieenabled
in javascript determine whether cookies enabled or not on client. working fine on browsers except ie. please using wrong method identifying cookies there wrong ie 10
the reliable way can think of check whether cookies enabled set cookie in response server in first place, , check it's set on client via document.cookie
. according this answer question, there's no point in checking cookieenabled
, doesn't provide correct information.
for instance, if server includes header in response serving page:
set-cookie: cc=1; max-age=3600
...then javascript code can check this:
if (/\bcc=/.test(document.cookie)) { // appear enabled } else { // not }
Comments
Post a Comment