Cookie

Discover the framework-neutral cookie returned by the storage.

A framework-neutral representation of a cookie to set on the response, returned when you read the session cookies. It carries every field a response target needs, so you can map it onto your framework’s response without losing information.

Croct's mascot winking
Looking for something specific?

Use the search bar at the top of the page or press / to quickly search through the documentation.

Use the summary below to quickly jump to a specific topic:

PageDescription
ConstructorLearn how to initialize a cookie.
getNameLearn how to read the cookie name.
getValueLearn how to read the cookie value.
getExpirationLearn how to read the cookie expiration time.
getPathLearn how to read the cookie path.
getDomainLearn how to read the cookie domain.
isSecureLearn how to check whether the cookie is sent only over HTTPS.
isHttpOnlyLearn how to check whether the cookie is hidden from client-side scripts.
getSameSiteLearn how to read the cookie SameSite policy.
toSetCookieHeaderLearn how to render the cookie as a Set-Cookie header value.