接口 ResponseCookie.ResponseCookieBuilder
- 封闭类:
- ResponseCookie
public static interface ResponseCookie.ResponseCookieBuilder
A builder for a server-defined HttpCookie with attributes.
-
方法概要
修饰符和类型方法说明build()Create the HttpCookie.Set the cookie "Domain" attribute.httpOnly(boolean httpOnly) Add the "HttpOnly" attribute to the cookie.maxAge(long maxAgeSeconds) Variant ofmaxAge(Duration)accepting a value in seconds.Set the cookie "Max-Age" attribute.Set the cookie "Path" attribute.Add the "SameSite" attribute to the cookie.secure(boolean secure) Add the "Secure" attribute to the cookie.Set the cookie value.
-
方法详细资料
-
value
Set the cookie value. -
maxAge
Set the cookie "Max-Age" attribute.A positive value indicates when the cookie should expire relative to the current time. A value of 0 means the cookie should expire immediately. A negative value results in no "Max-Age" attribute in which case the cookie is removed when the browser is closed.
-
maxAge
Variant ofmaxAge(Duration)accepting a value in seconds. -
path
Set the cookie "Path" attribute. -
domain
Set the cookie "Domain" attribute. -
secure
Add the "Secure" attribute to the cookie. -
httpOnly
Add the "HttpOnly" attribute to the cookie. -
sameSite
Add the "SameSite" attribute to the cookie.This limits the scope of the cookie such that it will only be attached to same site requests if
"Strict"or cross-site requests if"Lax".- 另请参阅:
-
build
ResponseCookie build()Create the HttpCookie.
-