Re: instant cookies?

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 23197
interpreted = N
texte = >>I want to set a cookie and read it immediately, to find out if the browser >>accepts cookies. If I can read the fresh cookie, I continue. In the other >>case I redirect to a different page...Christer wrote: >You can't set and read a cookie on the same page.PCS wrote: >...Until we get time travel working, you can't ask a browser to >send a cookie that it doesn't yet know about on the first hit.Well, I tried [TimeTravel seconds=5&direction=back] but it did not work :) The cookie in the website should protect some sort of game, which is not allowed without a cookie. I can set the cookie on the homepage and look for it on the game-page. But then I must forbid bookmarking of the game-page. Easy play, I thought, just ask for the correct referer and redirect to the homepage in case the referer does not fit. Nope - this (damned) MS Explorer does not deliver a referer in a frameset, when the calling link is in a different frameset, so I have no chance to validate the referring link...Next try was splitting the cookie-stuff into two pages, basically like this:index.tpl: [showif [getcookie MyCookie]=] [redirect setcookie.tpl] [/showif] ... do other things if cookie exists ...setcookie.tpl: [setcookie ....] [redirect index.tpl]Of course, I have actually more code, to avoid endless loops. But the whole thing doesn't work either, because the redirect in setcookie.tpl prevents complete loading of the page and the cookie is NOT set.Now I am lost. Is it right, that the only way is to present a useless page before the game with something to click on? Peter++++++++++++++++++++++++++++++++++++++++++++++++ Peter Ostry - Vienna/Austria - www.ostry.com Fon ++43-1-877 74 54 Fax ++43-1-877 74 54-21 ++++++++++++++++++++++++++++++++++++++++++++++++ Associated Messages, from the most recent to the oldest:

    
  1. Re: instant cookies? (Peter Ostry 1999)
  2. Re: instant cookies? (Brian B. Burton 1999)
  3. Re: instant cookies? (Christer Olsson 1999)
  4. Re: instant cookies? (Peter Ostry 1999)
  5. Re: instant cookies? (PCS Technical Support 1999)
  6. Re: instant cookies? (PCS Technical Support 1999)
  7. Re: instant cookies? (Christer Olsson 1999)
  8. instant cookies? (Peter Ostry 1999)
>>I want to set a cookie and read it immediately, to find out if the browser >>accepts cookies. If I can read the fresh cookie, I continue. In the other >>case I redirect to a different page...Christer wrote: >You can't set and read a cookie on the same page.PCS wrote: >...Until we get time travel working, you can't ask a browser to >send a cookie that it doesn't yet know about on the first hit.Well, I tried [TimeTravel seconds=5&direction=back] but it did not work :) The cookie in the website should protect some sort of game, which is not allowed without a cookie. I can set the cookie on the homepage and look for it on the game-page. But then I must forbid bookmarking of the game-page. Easy play, I thought, just ask for the correct referer and redirect to the homepage in case the referer does not fit. Nope - this (damned) MS Explorer does not deliver a referer in a frameset, when the calling link is in a different frameset, so I have no chance to validate the referring link...Next try was splitting the cookie-stuff into two pages, basically like this:index.tpl: [showif [getcookie MyCookie]=] [redirect setcookie.tpl] [/showif] ... do other things if cookie exists ...setcookie.tpl: [setcookie ....] [redirect index.tpl]Of course, I have actually more code, to avoid endless loops. But the whole thing doesn't work either, because the redirect in setcookie.tpl prevents complete loading of the page and the cookie is NOT set.Now I am lost. Is it right, that the only way is to present a useless page before the game with something to click on? Peter++++++++++++++++++++++++++++++++++++++++++++++++ Peter Ostry - Vienna/Austria - www.ostry.com Fon ++43-1-877 74 54 Fax ++43-1-877 74 54-21 ++++++++++++++++++++++++++++++++++++++++++++++++ Peter Ostry

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:

Register First (2000) [WebDNA] Combining searches with blank and zero values? (2011) HTTP Header / Meta Equiv (1999) I have troubles to send message out (1998) Javascript/WebCatalog form population (2001) [WebDNA] OT: How is this being done? Curious. (2009) WebCat2 beta 11 - new prefs ... (1997) WebCatalog can't find database (1997) WebCatalog for Postcards ? (1997) purchase plugin (1996) Generating unique SKU from [cart] (1997) CommandSecurity? (1997) Searching multiple Databases (1997) change the number format (1997) Error (1997) Grep question [parsing variables] problem (2003) Pull Down Search (2000) Fulfillment e-mail? (1998) Paranoid about serial numbers...not (1998) Multiple Currencies (2002)