Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cookie Demo needed
#4
(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.
 
Code:
 webapplication.Response.Cookies.Add(THTTPCookie.Create(CookieName,CookieValue,'/',Expireon,true));
ExpireOn is the UTCDateTime (as a Real).  Set to -1 for a session cookie.
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
Reply


Messages In This Thread
Cookie Demo needed - by cpstevenc - 04-24-2019, 02:42 AM
RE: Cookie Demo needed - by DanBarclay - 04-24-2019, 06:02 AM
RE: Cookie Demo needed - by cpstevenc - 04-25-2019, 05:05 AM
RE: Cookie Demo needed - by DanBarclay - 04-25-2019, 06:14 AM
RE: Cookie Demo needed - by cpstevenc - 05-05-2019, 05:57 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)