Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 28th, 2005, 03:36 PM
ClayDowling ClayDowling is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Flint, MI
Posts: 328 ClayDowling User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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/

Reply With Quote
  #2  
Old January 30th, 2005, 11:31 PM
tinyabs tinyabs is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 93 tinyabs User rank is Private First Class (20 - 50 Reputation Level)tinyabs User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 13 h 24 m 34 sec
Reputation Power: 4
You can use a program to see what you are sending.

There's a program call Fiddler that shows you that and more.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > TWebResponse and Cookies


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT