How can we check whether the cookie is enabled?

Platform: ASP.NET|Category: Client Side Scripting

It can be done by checking the read only property navigator.cookieEnabled. navigator.cookieEnabled will give the value true/false based on the browser support for cookies.

functionCookieEnabled() 
{ 
	if(navigator.cookieEnabled)
	{
		alert('Cookie Enabled');
	}
}