View Full Version : Adjusting Cookie

12-15-2011, 06:05 PM
Hey all,

I have set up a cookie that redirects the visitor if they have visited the page before. However, I'd like to make some adjustments to it to where if they have cookies turned off, it automatically redirects them to a page that requests them to turn on cookies. Any ideas?

num_days = 24;
function ged(noDays){
var today = new Date();
var expr = new Date(today.getTime() + noDays*60*60*1000);
return expr.toGMTString();

function readCookie(cookieName){
var start = document.cookie.indexOf(cookieName);
if (start == -1){
document.cookie = "seenit=yes; expires=" + ged(num_days);
} else {
window.location = go_to;

var go_to = "/index.php?module=article&id=310";


12-15-2011, 06:50 PM
nevermind. I figured it out. Looks like I'm finally starting to understand js