java.lang.Object
io.helidon.http.SetCookie
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent API builder forSetCookie
.static enum
The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context. -
Method Summary
Modifier and TypeMethodDescriptionstatic SetCookie.Builder
Creates a new fluent API builder.static SetCookie
Creates new instance.domain()
Domain of cookie.expires()
Expiration of cookie.boolean
httpOnly()
HttpOnly attribute of cookie.maxAge()
Max age of cookie.name()
Name of the cookie.static SetCookie
Parses new instance ofSetCookie
from the String representation.path()
Path of cookie.sameSite()
Same site attribute of cookie.boolean
secure()
Secure attribute of cookie.text()
Text representation of this cookie.toString()
Returns content of this instance as a 'Set-Cookie:' header value specified by RFC6265.value()
Value of the cookie.
-
Method Details
-
builder
Creates a new fluent API builder.- Parameters:
name
- a cookie name.value
- a cookie value.- Returns:
- a new fluent API builder
-
parse
Parses new instance ofSetCookie
from the String representation.- Parameters:
setCookie
- string representation- Returns:
- new instance
-
create
Creates new instance.- Parameters:
name
- a cookie name.value
- a cookie value.- Returns:
- a new instance with just the name and value configured
-
name
Name of the cookie.- Returns:
- the name.
-
value
Value of the cookie.- Returns:
- value
-
expires
Expiration of cookie.- Returns:
- expiration if defined
-
maxAge
Max age of cookie.- Returns:
- max age if defined
-
domain
Domain of cookie.- Returns:
- domain if defined
-
path
Path of cookie.- Returns:
- path if defined
-
secure
public boolean secure()Secure attribute of cookie.- Returns:
- whether secure was set
-
httpOnly
public boolean httpOnly()HttpOnly attribute of cookie.- Returns:
- whether
HttpOnly
was set
-
sameSite
Same site attribute of cookie.- Returns:
- same site if defined
-
text
Text representation of this cookie.- Returns:
- cookie text
-
toString
Returns content of this instance as a 'Set-Cookie:' header value specified by RFC6265.
-