const mixinafBedSheet::HttpCookies
afBedSheet::HttpCookies
(Service) - Use to manage your Cookies.
- add
abstract Void add(Cookie cookie)
Adds a Cookie to be sent to the client. New cookies are sent via a
Set-Cookie
HTTP response header.Example:
httpCookies.add(Cookie("foo", "123")) httpCookies.add(Cookie("persistent", "some val") { maxAge = 3day })
Cookies replace any other cookie with the same name.
Throws Err if response is already committed. @see web::WebRes.cookies
- all
abstract Cookie[] all()
Return a list of all the cookies, including those that have been set but not yet sent to the client.
- get
@
Operator
abstract Cookie? get(Str name)Retrieve a cookie by name. Returns
null
if not found.- remove
abstract Cookie? remove(Str cookieName)
Deletes a cookie by name, returning the deleted cookie. Returns
null
if the cookie was not found.Cookies are deleted from the client by setting the expired attribute to a date in the past.
Throws Err if response is already committed.