I need to know how to give the user a cookie when they visit the page for the first time in javascript. Then i need the cookie to expire in 1 hour and it to redirect them if the
if it is ok to use Jquery you can use the Jquery plugin
Set a cookie
$.cookie("example", "foo", { path: '/', expires: 7 });
Get a cookie
alert( $.cookie("example") );
Delete the cookie
$.cookie("example", null);
Using this you write your custom logic for redirection in javascript