0

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 solution), to run something once a day/session/week, etc?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
treddz
  • 1

2 Answers2

0

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

Community
  • 1
  • 1
typo.pl
  • 8,812
  • 2
  • 28
  • 29
0

Setting a cookie is the most compatible way to do this.

See the MDC document.cookie docs for the full story.

Community
  • 1
  • 1
Matt Ball
  • 354,903
  • 100
  • 647
  • 710