Represents an HTTP Cookie.

All cookies must have a name and a value and can optionally have other fields set such as path, domain, etc.

(Derived from io.netty.handler.codec.http.Cookie)

  • Cookie
    • Basic
      • Identifiable
      • Object
        • Anything

no subtypes hierarchy

Cookie(Cookie unknown)
Inherited Attributes
Attributes inherited from: Object
hash, string
encodeshared default String encode()

Encode the cookie to a string. This is what is used in the Set-Cookie header

getDomainshared default String? getDomain()
getNameshared default String getName()
getPathshared default String? getPath()
getValueshared default String getValue()
isChangedshared default Boolean isChanged()

Has the cookie been changed? Changed cookies will be saved out in the response and sent to the browser.

isFromUserAgentshared default Boolean isFromUserAgent()

Has this Cookie been sent from the User Agent (the browser)? or was created during the executing on the request.

setChangedshared default void setChanged(Boolean changed)

Set the cookie as being changed. Changed will be true for a cookie just created, false by default if just read from the request

  • changed

    true if changed

setDomainshared default Cookie setDomain(String? domain)

Sets the domain of this cookie

  • domain

    The domain to use

setHttpOnlyshared default Cookie setHttpOnly(Boolean httpOnly)

Determines if this cookie is HTTP only. If set to true, this cookie cannot be accessed by a client side script. However, this works only if the browser supports it. For for information, please look here.

  • httpOnly

    True if the cookie is HTTP only, otherwise false.

setMaxAgeshared default Cookie setMaxAge(Integer maxAge)

Sets the maximum age of this cookie in seconds. If an age of 0 is specified, this cookie will be automatically removed by browser because it will expire immediately. If java.lang.Long is specified, this cookie will be removed when the browser is closed. If you don't set this the cookie will be a session cookie and be removed when the browser is closed.

  • maxAge

    The maximum age of this cookie in seconds

setPathshared default Cookie setPath(String? path)

Sets the path of this cookie.

  • path

    The path to use for this cookie

setSecureshared default Cookie setSecure(Boolean secure)

Sets the security getStatus of this cookie

  • secure

    True if this cookie is to be secure, otherwise false

setValueshared default Cookie setValue(String value)

Sets the value of this cookie

  • value

    The value to set

Inherited Methods
Methods inherited from: Object