read and write you own cookies with webcat

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 14846
interpreted = N
texte = Greetings:If you need cookie support, here is an example of a cookie that counts the number of times someone visits your homepage. A page (default.tpl) reads the cookie and, if it finds it, adds one to the number of visits. If not it assigns 1 to the variable visits then it writes the cookie and redirects to your URL. You can easily modify this example to capture any kind of data you wish.1. Set up a default .tpl/.tmpl page with the following webDNA:=== begin default.tpl[ListCookies name=Visits] [math show=F]visits=[value]+1[/math] [/ListCookies][hideif [math]visits[/math]>0] [math show=F]visits=1[/math] [/hideif][returnraw]HTTP/1.0 302 Found Set-Cookie: Visits=[math]visits[/math]; expires=Wednesday, 09-Nov-1999 23:12:40 GMT; path=/; domain=www.yourdomain.com Location: home.tpl[/returnraw]=== end default.tpl2. Set up your default home page to accept this information for processing like:=== begin home.tpl My Title [ListCookies name=Visits] [showif [value]=1] Welcome! This is your first visit to our website. [/showif] [showif [value]>1] Welcome Back! Glad to see you have visited [value] times! [/showif] [showif [value]=100] But 100 times? Get a life! [/showif] [/ListCookies] === end home.tplMake sure you change the domain to your own domain and change the location to your home page.Aloha, Olin..................................................................... . W o r l d P o i n t Olin Kealoha Lagon . . The Language Company(TM) director, special projects . . . . Honolulu San Francisco olin@worldpoint.com . . 2800 woodlawn drive 222 sutter street www.worldpoint.com . . suite 170 sixth floor (v) 808.539.3978 . . honolulu, hi 96822 san francisco, ca 94108 (f) 808.539.3943 . . . . Over 3,000 Translators - Any Language, Any Time, Any Place . ..................................................................... Associated Messages, from the most recent to the oldest:

    
  1. Re: read and write you own cookies with webcat (Sandra L. Pitner 1997)
  2. Re: read and write you own cookies with webcat (Kenneth Grome 1997)
  3. Re: read and write you own cookies with webcat (Olin 1997)
  4. Re: read and write you own cookies with webcat (Kenneth Grome 1997)
  5. Re: read and write you own cookies with webcat (Sandra L. Pitner 1997)
  6. Re: read and write you own cookies with webcat (Olin 1997)
  7. Re: read and write you own cookies with webcat (Sandra L. Pitner 1997)
  8. Re: read and write you own cookies with webcat (Grant Hulbert 1997)
  9. Re: read and write you own cookies with webcat (Sandra L. Pitner 1997)
  10. read and write you own cookies with webcat (Olin 1997)
Greetings:If you need cookie support, here is an example of a cookie that counts the number of times someone visits your homepage. A page (default.tpl) reads the cookie and, if it finds it, adds one to the number of visits. If not it assigns 1 to the variable visits then it writes the cookie and redirects to your URL. You can easily modify this example to capture any kind of data you wish.1. Set up a default .tpl/.tmpl page with the following webDNA:=== begin default.tpl[ListCookies name=Visits] [math show=F]visits=[value]+1[/math] [/ListCookies][hideif [math]visits[/math]>0] [math show=F]visits=1[/math] [/hideif][returnraw]HTTP/1.0 302 Found Set-Cookie: Visits=[math]visits[/math]; expires=Wednesday, 09-Nov-1999 23:12:40 GMT; path=/; domain=www.yourdomain.com Location: home.tpl[/returnraw]=== end default.tpl2. Set up your default home page to accept this information for processing like:=== begin home.tpl My Title [ListCookies name=Visits] [showif [value]=1] Welcome! This is your first visit to our website. [/showif] [showif [value]>1] Welcome Back! Glad to see you have visited [value] times! [/showif] [showif [value]=100] But 100 times? Get a life! [/showif] [/ListCookies] === end home.tplMake sure you change the domain to your own domain and change the location to your home page.Aloha, Olin..................................................................... . W o r l d P o i n t Olin Kealoha Lagon . . The Language Company(TM) director, special projects . . . . Honolulu San Francisco olin@worldpoint.com . . 2800 woodlawn drive 222 sutter street www.worldpoint.com . . suite 170 sixth floor (v) 808.539.3978 . . honolulu, hi 96822 san francisco, ca 94108 (f) 808.539.3943 . . . . Over 3,000 Translators - Any Language, Any Time, Any Place . ..................................................................... Olin

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

[ShowNext] feature in 2.0 (1997) MacAuthorize order data fields WAS:How To question... (1997) Lookup Notfound (1998) Practice runs ? (1997) Big Databases (1997) [append] and SSL (1997) [TaxableTotal] - not working with AOL and IE (1997) NewCart+Search with one click ? (1997) [random] only for 1-100??? (1997) PGP signed email on Unix/MacOSX (2000) Disappearing records (2002) tcp connect includes (1999) cart info (1998) [OT] CSS div/span (2004) Set Line Item (1999) Newbie question (1998) Forcing a NEWCART (1997) delete a record and ssl (2005) [AppendFile] problem (WebCat2b13 Mac .acgi) (1997) Persistant Connections (2000)