I am using the script below to only see if a cookie is present, if so, redirecting to the page. I believe this is setting a cookie as well. Can someone please help edit this code so it will only check to see if cookie "COOKIENAME" is present, if so redirect to the url?
Thank you
// page to go to if cookie existsgo_to = "index.php?option=com_content&view=article&id=91&Itemid=73";function readCookie(FindWhere){ var start = document.cookie.indexOf(COOKIENAME); if (start == -1){ document.cookie = "User=yes"; expires=" + ged(num_days)"; } else { window.location = go_to; }}readCookie("User");
>>Can someone please help edit this code so it will only check to see if cookie "COOKIENAME" is presen
If the name of your cookie is actually "COOKIENAME" then change:
if( readCookie("User") )
If the name of your cookie is actually "COOKIENAME" then change:
if( readCookie("User") )
to:
if( readCookie("COOKIENAME") )