c_shelswell Posted December 12, 2007 Share Posted December 12, 2007 Hi I'm having a bit of a problem checking cookies in ie6. The below works fine in Firefox and if cookies are enabled works fine in ie6 but if i disable cookies ie6 doesn't display the message to say so. I've tried a number of different scripts to sort this but so far it's all the same story. Any ideas would be great. var cookieEnabled=(navigator.cookieEnabled)? true : false if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled){ document.cookie="testcookie" cookieEnabled=(document.cookie.indexOf("testcookie")!=-1)? true : false } if (cookieEnabled) { document.write('ENABLED - Good to go!'); } else { document.write('<span class="errorMsg"><a href="./login/cookie-help.html" target="_blank" >DISABLED CLICK HERE</a></span>'); } Cheers Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 12, 2007 Share Posted December 12, 2007 try some of these search results - they may give you a better idea about how to use JavaScript cookies: http://www.google.com/search?hl=en&q=JavaScript+Cookie&btnG=Google+Search Quote Link to comment Share on other sites More sharing options...
c_shelswell Posted December 13, 2007 Author Share Posted December 13, 2007 cheers I'll give them a go tomorrow. I have tried this one http://techpatterns.com/downloads/javascript_cookies.php but again same story fine with ffox and fine with ie6 when they're turned on but not the other way. Quote Link to comment Share on other sites More sharing options...
c_shelswell Posted December 18, 2007 Author Share Posted December 18, 2007 Hi i'm still having real troubles with this. Tried the suggestions but still ie6 won't display anything if cookies are turned off. Any help would be really great Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.