Jump to content

Read and Write to Cookies

Recommended Posts

You can use the W3CookieStorage unit, it exposes a "Cookies" static class.


For instance


Cookies.Values['test'] := 'hello';


will write 'hello' to a cookie named 'test'. You can read a cookie in a similar fashion, or use the methods WriteString/ReadString (WriteString also allows to specify the cookie expiration).


Finally the Erase method will erase a given cookie.

Link to post
Share on other sites
  • 4 years later...


Do you have any migration details for Cookies management?


I think ASmartBook samples have not been upgraded


I've added in uses:

System.Widget, SmartCL.Storage, SmartCL.Cookies,

SmartCL.Storage.Session, SmartCL.Storage.Local, SmartCL.Storage.Cookie


But I'm stuck with "Cookies" intance

output.Text := Cookies['ASmartBook-Key'];




Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...