Re: read and write you own cookies with webcat
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 14852
interpreted = N
texte = Thanks for the low-calorie cookie recipes! Is a redirect necessary or is that the only way to actually write thecookie? Thanks again!SandyOlin wrote:> > 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.tpl> > 2. Set up your default home page to accept this information for> processing like:> > === begin home.tpl> > > > >
> My Title> > > > vlink=#990000>> > [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.tpl> > Make 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:
Thanks for the low-calorie cookie recipes! Is a redirect necessary or is that the only way to actually write thecookie? Thanks again!SandyOlin wrote:> > 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.tpl> > 2. Set up your default home page to accept this information for> processing like:> > === begin home.tpl> > > > >
> My Title> > > > vlink=#990000>> > [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.tpl> > Make 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 .> .....................................................................
Sandra L. Pitner
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:
Grep Help (2003)
Spontaneous Errors (2004)
[WebDNA] Best practice re: password storage (2013)
Not really WebCat (1997)
Round UP to nearest 100 (2007)
groups and [ShowNext] (1997)
available times? (2003)
Cancel Subscription (1996)
listfiles-looking for slick solution (1997)
Multiple cart additions (1997)
Bad match! (2002)
version 2 for NT (1997)
WebCatalog 4.0.2b5 available (2000)
Re[2]: Next X hits (1996)
Can't Search field (1998)
Using Plug-In while running 1.6.1 (1997)
Logging purchases (1997)
Forumulas.db & Variables (2002)
NT version and O'reily's WebSite (1997)
Using [Include] Context (1999)