Jump to content

Checking cookie status not working in ie6


c_shelswell

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.