I’m trying to get and set cookies without having to resort to JavaScript.
The first page is a form, HomePage, with these two fields on it:
SurveyID: Comp’d For Display; Gets ID from URL
SetCookie: CFD: @SetHTTPHeader(“Set-Cookie”; “SID=”+SurveyID)
SurveyID is being set properly. SetCookie is returning a value of 1 (True), indicating that it succesfully set the cookie.
The next form, Instructions, has this field:
SurveyID: CFD; @GetHTTPHeader(“Set-Cookie”)
But it is blank. I also tried the obviously wrong formula @GetHTTPHeader(“Get-Cookie”).
I want it to retreive the value of SurveyID. What did I do wrong?
Thanks in advance.
-Jeff
Subject: @Set/GetHTTPHeader not setting cookies
“What did I do wrong?”
You used @GetHTTPHeader(“Get-Cookie”) instead of the correct @GetHTTPHeader(“Cookie”).
Subject: RE: @Set/GetHTTPHeader not setting cookies
Yup, that was it. Where do they tell you the correct names for HTTP header fields? I couldn’t find them at w3c.org.
Thanks.
Subject: RE: @Set/GetHTTPHeader not setting cookies
All of the actual standard header fields are in RFC 2616, sections 5 and 14:
http://www.w3.org/Protocols/rfc2616/rfc2616.html
“set-cookie” and “cookie” are in a proposed RFC (not a real standard yet), 2109:
http://www.w3.org/Protocols/rfc2109/rfc2109
Subject: RE: @Set/GetHTTPHeader not setting cookies
Well, I dunno; I only knew that one specifically from using it in particular.