I have a so called squeeze page (meaning visitors have to leave their email address to access the site). I'd like to set a persistent cookie that expires in say a year, and that redirect people with the cookie set from www.squeezpage.com/index.html to www.squeezepage.com/main.html

Can anyone tell me how to do this or point me to a good tutorial? Been reading for a while now, and am still pretty confused...