PDA

View Full Version : Cookies!


STOMPFROG
07-09-2007, 09:33 AM
I am working on a satisfaction survey for a website and have made a pop up which I want to pop when a user enters the site.

I do not want the pop up to appear again for 30days if someone has already taken the test.

I know how to set and retrieve cookies but do not know how to set an expiry time of 30 days. How can I modify the following code to take this into account?

Thanks

function cookies() {
document.cookie = 'userSurvey=taken; expires=Fri, 3 Aug 2001 20:47:11 UTC; path=/';
}

STOMPFROG
07-09-2007, 09:38 AM
Eeek! Should have searched first... just found my answer!

http://www.htmlforums.com/client-side-scripting/t-help-with-a-cookie-91995.html/?highlight=cookie

PS - Feel free to delete this thread please moderator!