logo

class

web::Cookie

sys::Obj
  web::Cookie

Cookie models an HTTP cookie used to pass data between the server and brower as defined by RFC 2965 and RFC 2109. See WebReq.cookies and WebRes.cookies.

Slots

comment

Str comment

Provided to allow users to organize their cookies. Defaults to null.

domain

Str domain

Specifies the domain for which the cookie is valid. An explicit domain must always start with a dot. If null (the default) then the cookie only applies to the server which set it.

fromStr

static Cookie fromStr(Str s)

Parse a HTTP cookie header name/value pair. Throw ParseErr if not formatted correctly.

maxAge

Duration maxAge

Defines the lifetime of the cookie, after the the max-age elapses the client should discard the cookie. The duration is floored to seconds (fractional seconds are truncated). If maxAge is null (the default) then the cookie persists until the client is shutdown. If zero is specified, the cookie is discarded immediately.

name

Str name

Name of the cookie. Names must be HTTP tokens and never start with $.

path

Str path

Specifies the subset of URLs to which the cookie applies. If null (the default), then the cookie applies to all paths.

secure

Bool secure

If true, then the client only sends this cookie using a secure protocol such as HTTPS. Defaults to false.

toStr

override Str toStr()

Return the cookie formatted as an HTTP header.

value

Str value

Value string of the cookie.

version

Str version

Specified which version of HTTP statement management is being used. Default is "1".