| Modifier and Type | Method and Description |
|---|---|
Http.Cookie |
build() |
Http.CookieBuilder |
withDomain(String domain) |
Http.CookieBuilder |
withHttpOnly(boolean httpOnly) |
Http.CookieBuilder |
withMaxAge(Duration maxAge)
Set the maximum age of the cookie.
|
Http.CookieBuilder |
withMaxAge(Integer maxAge)
Deprecated.
As of 2.6.0, use withMaxAge(Duration) instead.
|
Http.CookieBuilder |
withName(String name) |
Http.CookieBuilder |
withPath(String path) |
Http.CookieBuilder |
withSameSite(Http.Cookie.SameSite sameSite) |
Http.CookieBuilder |
withSecure(boolean secure) |
Http.CookieBuilder |
withValue(String value) |
public Http.CookieBuilder withName(String name)
name - The name of the cookiepublic Http.CookieBuilder withValue(String value)
value - The value of the cookie@Deprecated public Http.CookieBuilder withMaxAge(Integer maxAge)
maxAge - The maxAge of the cookie in secondspublic Http.CookieBuilder withMaxAge(Duration maxAge)
builder.withMaxAge(Duration.of(40, ChronoUnit.DAYS))maxAge - a duration representing the maximum age of the cookie. Will be truncated to the nearest second.public Http.CookieBuilder withPath(String path)
path - The path of the cookiepublic Http.CookieBuilder withDomain(String domain)
domain - The domain of the cookiepublic Http.CookieBuilder withSecure(boolean secure)
secure - specify if the cookie is securepublic Http.CookieBuilder withHttpOnly(boolean httpOnly)
httpOnly - specify if the cookie is httpOnlypublic Http.CookieBuilder withSameSite(Http.Cookie.SameSite sameSite)
sameSite - specify if the cookie is SameSitepublic Http.Cookie build()