View Full Version : Cookies, Thats javascript right?

07-03-2005, 05:53 AM
What I am doing is you are at a page and you enter a number in a text box and it takes you to a certian page. And the help I need is when to set the expiration date. I cant make it a single date or every time no matter what number they press they will go to the same page, the first one. Is there a way to say to use it only once? Or delete it after it uses it?

07-03-2005, 06:21 PM
The idea is that the expiery date is set to the current date plus a period time

the cookie will be deleted on that date

if you revisit the page the expiery date will be from that visit

to delete the cookie set the date to a date prior to the current date.

There are many articas on the web that can expain this more fully

Mr J
07-03-2005, 10:23 PM
Can you post your code?

I have a cookie script that only allows a function to be run once within a set number of days.

You can set the number of days the cookie remains active.

For an example see


This may be adapted to suit your needs

07-04-2005, 06:06 AM
Sorry can't show you the code, I deleted it and am gonna start over. but from your post I have a pretty good idea of what to do now. Thanks