0

Hi Anyone please help me:

var cookieBlockedUrl = ""<%URL%>"";
var cookieName = ""cmdTestCookie"";
xDeleteCookie(cookieName); // don't get false positive
document.cookie = cookieName + ""=test; path=/"";
var cookieString = document.cookie || """";
var cookies = cookieString.split(/\s*;\s*/);
var cookieFound = 0;
for (var i in cookies) {
var cookie = cookies[i];
var dough = cookie.split(/\s*=\s*/);
if (dough[0] == cookieName) { 
cookieFound = 1; break; 
}
}
xDeleteCookie(cookieName);
if (cookieFound != 1) {
window.location = cookieBlockedUrl
} 
function xDeleteCookie(name) {
var oldDate = new Date(1970, 1, 1);
document.cookie = cookieName + ""=0; expires="" + oldDate.toGMTString();
}"

Above code is for redirecting to a specific page if the cookies are blocked from the browser the page is redirecting in every browser but not only in Internet Explorer 11

  • but still it is not working in IE 11 might be document.cookie is not behaving properly in IE 11 – Akash Deep Mar 23 '20 at 12:29
  • please review existing questions on the same topic. e.g. https://stackoverflow.com/questions/4603289/how-to-detect-that-javascript-and-or-cookies-are-disabled – mybrave Mar 23 '20 at 12:48

0 Answers0