类 ResponseCookie
java.lang.Object
cn.taketoday.http.HttpCookie
cn.taketoday.http.ResponseCookie
An
HttpCookie subclass with the additional attributes allowed in
the "Set-Cookie" response header. To build an instance use the from(java.lang.String)
static method.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev, Brian Clozel
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明private static classDefault implementation ofResponseCookie.ResponseCookieBuilder.static interfaceA builder for a server-defined HttpCookie with attributes.private static class -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleanFactory method to obtain a builder for a server-defined cookie, given its name only, and where the value as well as other attributes can be set later via builder methods.Factory method to obtain a builder for a server-defined cookie that starts with a name-value pair and may also include attributes.fromClientResponse(String name, String value) Factory method to obtain a builder for a server-defined cookie.Return the cookie "Domain" attribute, ornullif not set.Return the cookie "Max-Age" attribute in seconds.getPath()Return the cookie "Path" attribute, ornullif not set.Return the cookie "SameSite" attribute, ornullif not set.inthashCode()booleanReturntrueif the cookie has the "HttpOnly" attribute.booleanisSecure()Returntrueif the cookie has the "Secure" attribute.mutate()Return a builder pre-populated with values from"this"instance.toString()从类继承的方法 cn.taketoday.http.HttpCookie
getName, getValue
-
字段详细资料
-
maxAge
-
domain
-
path
-
secure
private final boolean secure -
httpOnly
private final boolean httpOnly -
sameSite
-
-
构造器详细资料
-
方法详细资料
-
getMaxAge
Return the cookie "Max-Age" attribute in seconds.A positive value indicates when the cookie expires relative to the current time. A value of 0 means the cookie should expire immediately. A negative value means no "Max-Age" attribute in which case the cookie is removed when the browser is closed.
-
getDomain
Return the cookie "Domain" attribute, ornullif not set. -
getPath
Return the cookie "Path" attribute, ornullif not set. -
isSecure
public boolean isSecure()Returntrueif the cookie has the "Secure" attribute. -
isHttpOnly
public boolean isHttpOnly()Returntrueif the cookie has the "HttpOnly" attribute. -
getSameSite
Return the cookie "SameSite" attribute, ornullif not set.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".- 另请参阅:
-
mutate
Return a builder pre-populated with values from"this"instance. -
equals
- 覆盖:
equals在类中HttpCookie
-
hashCode
public int hashCode()- 覆盖:
hashCode在类中HttpCookie
-
toString
- 覆盖:
toString在类中HttpCookie
-
from
Factory method to obtain a builder for a server-defined cookie, given its name only, and where the value as well as other attributes can be set later via builder methods.- 参数:
name- the cookie name- 返回:
- a builder to create the cookie with
-
from
Factory method to obtain a builder for a server-defined cookie that starts with a name-value pair and may also include attributes.- 参数:
name- the cookie namevalue- the cookie value- 返回:
- a builder to create the cookie with
-
fromClientResponse
Factory method to obtain a builder for a server-defined cookie. Unlikefrom(String, String)this option assumes input from a remote server, which can be handled more leniently, e.g. ignoring an empty domain name with double quotes.- 参数:
name- the cookie namevalue- the cookie value- 返回:
- a builder to create the cookie with
-