
January 28th, 2005, 03:36 PM
|
|
Contributing User
|
|
Join Date: Oct 2002
Location: Flint, MI
Posts: 328
Time spent in forums: 1 h 19 m 25 sec
Reputation Power: 7
|
|
|
TWebResponse and Cookies
I'm building a CGI (not ISAPI) application using Delphi 6. The applications needs to send cookies, and I've verified in my code that the cookie in fact exists in the Response object, with valid values. An example cookie looks like this:
HCAI=51; domain=clayd; path=/; expires=Fri, 28 Jan 2005 16:11:43 GMT
As nice as the cookie looks in the Response object, it would look even better in the headers of the response from the web server. It's not getting that far. The relevant code is:
Code:
cookie := Response.Cookies.Add;
cookie.Name := CookieName;
cookie.Value := Format('%d', [sesNumber]);
cookie.Path := '/';
cookie.Domain := Request.Host;
cookie.Expires := IncHour(Now);
{Some intermediate processing that doesn't touch the Response object snipped}
Response.ContentType := 'text/html';
Response.Content := tp.Element['main'];
Response.StatusCode := 200;
Response.SendResponse;
{At this point the cookie is verified to exist in the Response object}
I'd just love to know why the cookie isn't going out. The expected HTML is appearing just fine, it's just cookie-free. Anybody else have experience with this? Is this a bug in Delphi 6 TWebResponse? Did I do something clueless?
__________________
Clay Dowling
Lazarus Notes
Articles and commentary on web development
http://www.lazarusid.com/notes/
|