Title: Expire date for cookies don't work Post by: milvards on February 01, 2010, 12:58:53 PM Hi.
I'm trying to set a cookie like this: AResponseInfo.Cookie['cookiename'] := 'something; expires=31-Jan-2011 00:00:00 GMT;'; I've tried different date formats, but no matter what I do they get expiration date: At end of session. This happens in different browsers. Can anyone tell me what I'm doing wrong. I'm using SDK 3.47. Regards, Roy M. Milvardsen PS! By the way, why can't I make a new topic in PRO Support? Title: Re: Expire date for cookies don't work Post by: D.Tkalcec (RTC) on February 01, 2010, 01:14:57 PM Where did "AResponseInfo" come from? IOW, how was it initialized or where was it acquired?
PS. You can not post in the PRO Support section because you have the Basic subscription, but PRO Support is available only in Bronze, Silver and Gold subscriptions. For more information on what you get with each subscription, please visit the RTC SDK Price and Order page: http://www.realthinclient.com/order.htm Best Regards, Danijel Tkalcec Title: Re: Expire date for cookies don't work Post by: milvards on February 01, 2010, 02:20:21 PM Thanks for your prompt answer.
AResponseInfo is of type TRtcResponse and is used like this: procedure TServerDataModule.RtcDataProvider1DataReceived(Sender: TRtcConnection) //Event TRtcDataServer(Sender).Response.Cookie['cookiename'] := 'something; expires=31-Jan-2011 00:00:00 GMT;'; I discovered that if I changed this to: TRtcDataServer(Sender).Response.Cookie['cookiename'] := 'something; expires=Mon, 31-Jan-2011 00:00:00 GMT;'; it worked. Seems like I had to include short day name to make it work. But as I am in Norway the default here would have been in Norwegian. I.E.: TRtcDataServer(Sender).Response.Cookie['cookiename'] := 'something; expires=sø, 30-mai-2010 00:00:00 GMT;'; This fails. Do you know if I have to use English day and month names here? Thanks, Roy M. Title: Re: Expire date for cookies don't work Post by: D.Tkalcec (RTC) on February 01, 2010, 02:27:20 PM http://en.wikipedia.org/wiki/HTTP_cookie
Title: Re: Expire date for cookies don't work Post by: milvards on February 01, 2010, 03:20:20 PM Thanks for your help, Danijel.
After using English for months and weekdays all went like a dream. Odd since Windows and IE8 is with Norwegian settings. Best regards, Roy m. Title: Re: Expire date for cookies don't work Post by: D.Tkalcec (RTC) on February 01, 2010, 06:10:58 PM Browser settings have very little to do with the HTTP standard. What you set up in your browser is the graphical user interface language (menus,dialogs, etc), which has no impact on the underlying protocol.
Best Regards, Danijel Tkalcec |