Question

I am setting a cookie to hide a cookie notice on a my website.

This works fine in all other browsers but Google Chrome(and Opera to it seems) (not even tested in IE yet)

Here is my code that reads out the cookies and makes the decision whether to run the show function or do nothing.

This function is called up on page load

 checkCookie = function() {
        var myCookieSet = getCookie("useofcookies");
        if (myCookieSet != "closed"){
            alert('cookie is not set and = '+  myCookieSet);
            // run the show info bar function
            init();     
        }else {
            alert('cookie HAS BEEN set and = '+  myCookieSet);
        }
};

I cannot figure out what I have done wrong. Full js file can be found here:

Cookie Notice - Pastebin

Any clues as to why would this is happening in Chrome alone would be a great help

Was it helpful?

Solution

Have you tried clearing your cache and cookies? IE a 'clean browser'?

The code looks fine and when I use your code it seems to work for me. Even in IE 8/9

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top