setting cookies with [setcookie]
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 17085
interpreted = N
texte = I was testing out [setcookie] in preparation for using cookies on a site. I had copied and pasted the code out of the PDF reference manual:>[setcookie name=Visits&value=12>&expires=Wednesday, 09-Nov-1999 23:12:40 GMT>&path=/&domain=www.smithmicro.com]changed the name, value and domain entries accordingly and tried it out. Worked like a charm! Later, after some editing and adding a page to try zeroing out the cookie values, I couldn't figure out why it no longer worked. Nothing. After telling Navigator to warn me before setting cookies, I could see that WebCatalog wasn't even trying to send them. Some head pounding later, I realized that I had pulled the [setcookie] tag together to fit on one line:[setcookie name=Visits&value=12&expires=Wednesday, 09-Nov-1999 23:12:40 GMT&path=/&domain=www.smithmicro.com]and that was causing it to fail. After breaking it up like the original, everything worked fine again.This sounds like a problem related to what's described here for the [listcookies] context:>Remember that MIME headers require a linefeed as a line separator (or >carriage return / linefeed combination). If you are using a text editor on the>Macintosh you must past a linefeed in after each line or set the file to a>DOS or UNIX mode.Of course there, the example for setting the cookie doesn't use [setcookie], but instead:>[returnraw]HTTP/1.0 200 OK>Set-Cookie: text=abcd; expires=Wednesday, 01-Dec-1999>23:23:23 GMT; path=/; domain=www.yourdomain.com>Cookie set.>[/returnraw]which is a slightly different placement of linebreaks as well! I don't know of any other tags were a linebreak *within* the tag affects the tag's performance. A line of explanation in the manual would have saved two days of confusion here -- it may have been resolved on the online reference manual, but the link at Pacific Coast (http://test.smithmicro.com/WebDNAReference/) has been coming up with a template not found since I first tried it a few days ago.Rob MarquardtDesigner/Resident WireheadToast Design300 First Avenue North, Suite 150Minneapolis MN 55401612.330.9863 v612.321.9424 fwww.toastdesign.com
Associated Messages, from the most recent to the oldest:
| |
- setting cookies with [setcookie] (Rob Marquardt 1998)
|
I was testing out [setcookie] in preparation for using cookies on a site. I had copied and pasted the code out of the PDF reference manual:>[setcookie name=Visits&value=12>&expires=Wednesday, 09-Nov-1999 23:12:40 GMT>&path=/&domain=www.smithmicro.com]changed the name, value and domain entries accordingly and tried it out. Worked like a charm! Later, after some editing and adding a page to try zeroing out the cookie values, I couldn't figure out why it no longer worked. Nothing. After telling Navigator to warn me before setting cookies, I could see that WebCatalog wasn't even trying to send them. Some head pounding later, I realized that I had pulled the [setcookie] tag together to fit on one line:[setcookie name=Visits&value=12&expires=Wednesday, 09-Nov-1999 23:12:40 GMT&path=/&domain=www.smithmicro.com]and that was causing it to fail. After breaking it up like the original, everything worked fine again.This sounds like a problem related to what's described here for the [listcookies] context:>Remember that MIME headers require a linefeed as a line separator (or >carriage return / linefeed combination). If you are using a text editor on the>Macintosh you must past a linefeed in after each line or set the file to a>DOS or UNIX mode.Of course there, the example for setting the cookie doesn't use [setcookie], but instead:>
[returnraw]HTTP/1.0 200 OK>Set-Cookie: text=abcd; expires=Wednesday, 01-Dec-1999>23:23:23 GMT; path=/; domain=www.yourdomain.com>Cookie set.>[/returnraw]which is a slightly different placement of linebreaks as well! I don't know of any other tags were a linebreak *within* the tag affects the tag's performance. A line of explanation in the manual would have saved two days of confusion here -- it may have been resolved on the online reference manual, but the link at Pacific Coast (http://test.smithmicro.com/WebDNAReference/) has been coming up with a template not found since I first tried it a few days ago.Rob MarquardtDesigner/Resident WireheadToast Design300 First Avenue North, Suite 150Minneapolis MN 55401612.330.9863 v612.321.9424 fwww.toastdesign.com
Rob Marquardt
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:
[WebDNA] Integrating with WP and PHP (2011)
using webdna to determine pixel parameters (2000)
Sendmail - Attachment / My First Post (2001)
Nesting WebDNA in JavaScript (2003)
WebCatalog NT beta 18 now available (1997)
Sending & and other chars thru an append context (2002)
iis 4.0 (1997)
Associative lookup style? + bit more (1997)
Emailer help....! (1997)
numfound=0 for a search after going into the SSL (2003)
Comments in db? (1997)
Database changes (1998)
syntax question, not in online refernce (1997)
NewCart+Search with one click ? (1997)
remotely add + sign (1997)
downloading binary files ussing mime and tcpconnect (2004)
bannerads example idiot (1997)
OT-test (1998)
problems with 2 tags shakur (1997)
Possible Bug in 2.0b15.acgi (1997)