Daily Welcome Cookie | JavaScriptSource

Daily Welcome Cookie

Ted Man Nov 21, 2007


This script sets a cookie, with an alert window that only comes up the first time you visit the page each day. Good for calling attention to daily specials and news updates. Can be configured to work in other ways also.


  • Created by: Ted Man
  • Posted: November 21, 2007

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: dailyCookie.js


Paste this code into the HEAD section of your HTML document.

Leave a Response


For redirecting, instead of the line:[br /][br /]alert('Be shure to check our daily specials!')[br /][br /]add this:[br /][br /]function redir () {ttms=window.open("http://yourURL");}function cancel () {}if (confirm("\nMESSAGE LINE 1\n MESSAGE LINE 2.")) {redir();} else cancel()

3433 Aug 24, 2008

That would be a redirect cookie. You can check our [a href="http://javascript.internet.com/cookies/"]cookies[/a] scripts or submit your question to the [a href="http://www.webdeveloper.com/forum/forumdisplay.php?f=3"]JavaScript Forum[/a] for further help.

Lee Dec 4, 2007

That type of information can be found in a tutorial on JavaScript cookies. You can find a few [a href="http://javascript.internet.com/cookies/"]here[/a], as well as other places on the Web.

Lee Dec 4, 2007

Hello[br /][br /]This is a cool script, How about adding a var in there like so there is two options "ok" "no thanks" then when they hit "ok" it could bring them to a url , if they hit "no thanks" then the box would just close.[br /][br /]Thanks in advance for listening to me, and let ,me know if you do that , I could use something like that[br /][br /]Great job on this thou[br /][br /]Joe

Joseph Nov 29, 2007

We need some EXAMPLES of how to use Daily Cookie besides just the JS file and <head> elements.[br /][br /]How do we actually USE the thing?

DPM Nov 26, 2007