Te paso un ejemplo:
<html>
<head>
<script language="JavaScript"><!--
// Como saber si el cliente tiene la opcion de cookies habilitada
//
[email protected] rhrn = new Date();
rhrnt1 = rhrn.getTime();
rhrns1 = rhrn.getSeconds();
rhrnm1 = rhrn.getMinutes();
rhrnh1 = rhrn.getHours();
// this is arbitrary - it just looks like a normal cookie
cookievar1 = "AE87BC5C097ADD230B543BCD8" + rhrnh1 + rhrnm1 + rhrns1;
SetCookie ('tracker_id', cookievar1, 56);
if (GetCookie('tracker_id') == cookievar1)
{
rhrn2 = new Date();
rhrnt2 = rhrn2.getTime();
}
else
{
rhrnt2 = 0
}
if (rhrnt2 < (rhrnt1 + 300) && rhrnt2 > 0)
{
cookStatus = "You have cookies automatically enabled";
}
else
{
if (rhrnt2 == 0)
{
cookStatus = "You have cookies disabled";
}
else
{
cookStatus = "You are clicking yes to cookies manually";
}
}
function GetCookie(cookieName)
{
var theCookie=""+document.cookie;
var ind=theCookie.indexOf(cookieName);
if (ind==-1 || cookieName=="") return null;
var ind1=theCookie.indexOf(';',ind);
if (ind1==-1) ind1=theCookie.length;
return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}
function SetCookie(cookieName,cookieValue,nDays)
{
var today = new