I am using the following cookie:
var $j = jQuery.noConflict(); $j(document).ready(function(){ if (document.cookie.indexOf(\'visited=true\') == -1)
document.cookie = valuename + "=" + value + "; " + expires + ";domain=;path=/";
This "domain=;path=/"; will take dynamic domain as its cookie will work in subdomain. It will work if you want to test in localhost.
"domain=;path=/";