05-05-2019, 05:57 AM
(04-25-2019, 06:14 AM)DanBarclay Wrote:(04-25-2019, 05:05 AM)cpstevenc Wrote: I ran into those too.. either calls changed, or missing some information in those original posts.
I need cookies that are not locked to the session. So user can come back at a later date and data is there to grab?
Try this to set your cookie.
ExpireOn is the UTCDateTime (as a Real). Set to -1 for a session cookie.Code:webapplication.Response.Cookies.Add(THTTPCookie.Create(CookieName,CookieValue,'/',Expireon,true));
Name/Value are String.
Try this to read the cookie:
Code:Result := webapplication.Request.CookieFields.Values[sName];
It should work, but there may be better ways.
Dan
Thanks!
UTCDateTime was my issue.
Also used Chrome inspector and took me a bit to find the call that was actually kicking off the COOKIE code to save and saw my date being used was in like 1927 .... so expired