I got an "intro" running on my site, but I don't want it to repeat for a certain amount of time.
How exactly do you set and define a cookie (or is there any better sol开发者_运维知识库ution), to run something once a day/session/week, etc?
You could set the cookie to expire one day/week from now to handle "once a day, week" scenarios. I don't know about "once a session" - how do you define a 'session' and when does it begin/end?
See Stackoverflow -how to set cookie to expire in 1 hour
Setting a cookie is the most compatible way to do this.
See the MDC document.cookie
docs for the full story.
精彩评论