Package org.eclipse.jetty.http
Class HttpCookie
- java.lang.Object
-
- org.eclipse.jetty.http.HttpCookie
-
@Deprecated(since="2021-05-27") public class HttpCookie extends java.lang.Object
Deprecated.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpCookie.SameSite
Deprecated.static class
HttpCookie.SetCookieHttpField
Deprecated.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
HTTP_ONLY_COMMENT
Deprecated.If this string is found within the comment parsed withisHttpOnlyInComment(String)
the check will return truestatic java.lang.String
SAME_SITE_DEFAULT_ATTRIBUTE
Deprecated.Name of context attribute with default SameSite cookie valuestatic java.lang.String
SAME_SITE_LAX_COMMENT
Deprecated.static java.lang.String
SAME_SITE_NONE_COMMENT
Deprecated.static java.lang.String
SAME_SITE_STRICT_COMMENT
Deprecated.
-
Constructor Summary
Constructors Constructor Description HttpCookie(java.lang.String setCookie)
Deprecated.HttpCookie(java.lang.String name, java.lang.String value)
Deprecated.HttpCookie(java.lang.String name, java.lang.String value, long maxAge)
Deprecated.HttpCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path)
Deprecated.HttpCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path, long maxAge, boolean httpOnly, boolean secure)
Deprecated.HttpCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path, long maxAge, boolean httpOnly, boolean secure, java.lang.String comment, int version)
Deprecated.HttpCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path, long maxAge, boolean httpOnly, boolean secure, java.lang.String comment, int version, HttpCookie.SameSite sameSite)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
asString()
Deprecated.java.lang.String
getComment()
Deprecated.static java.lang.String
getCommentWithAttributes(java.lang.String comment, boolean httpOnly, HttpCookie.SameSite sameSite)
Deprecated.static java.lang.String
getCommentWithoutAttributes(java.lang.String comment)
Deprecated.java.lang.String
getDomain()
Deprecated.long
getMaxAge()
Deprecated.java.lang.String
getName()
Deprecated.java.lang.String
getPath()
Deprecated.java.lang.String
getRFC2965SetCookie()
Deprecated.java.lang.String
getRFC6265SetCookie()
Deprecated.HttpCookie.SameSite
getSameSite()
Deprecated.static HttpCookie.SameSite
getSameSiteDefault(ServletContext context)
Deprecated.Get the default value for SameSite cookie attribute, if one has been set for the given context.static HttpCookie.SameSite
getSameSiteFromComment(java.lang.String comment)
Deprecated.java.lang.String
getSetCookie(CookieCompliance compliance)
Deprecated.java.lang.String
getValue()
Deprecated.int
getVersion()
Deprecated.boolean
isExpired(long timeNanos)
Deprecated.boolean
isHttpOnly()
Deprecated.static boolean
isHttpOnlyInComment(java.lang.String comment)
Deprecated.boolean
isSecure()
Deprecated.
-
-
-
Field Detail
-
HTTP_ONLY_COMMENT
public static final java.lang.String HTTP_ONLY_COMMENT
Deprecated.If this string is found within the comment parsed withisHttpOnlyInComment(String)
the check will return true- See Also:
- Constant Field Values
-
SAME_SITE_NONE_COMMENT
public static final java.lang.String SAME_SITE_NONE_COMMENT
Deprecated.- See Also:
- Constant Field Values
-
SAME_SITE_LAX_COMMENT
public static final java.lang.String SAME_SITE_LAX_COMMENT
Deprecated.- See Also:
- Constant Field Values
-
SAME_SITE_STRICT_COMMENT
public static final java.lang.String SAME_SITE_STRICT_COMMENT
Deprecated.- See Also:
- Constant Field Values
-
SAME_SITE_DEFAULT_ATTRIBUTE
public static final java.lang.String SAME_SITE_DEFAULT_ATTRIBUTE
Deprecated.Name of context attribute with default SameSite cookie value- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HttpCookie
public HttpCookie(java.lang.String name, java.lang.String value)
Deprecated.
-
HttpCookie
public HttpCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path)
Deprecated.
-
HttpCookie
public HttpCookie(java.lang.String name, java.lang.String value, long maxAge)
Deprecated.
-
HttpCookie
public HttpCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path, long maxAge, boolean httpOnly, boolean secure)
Deprecated.
-
HttpCookie
public HttpCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path, long maxAge, boolean httpOnly, boolean secure, java.lang.String comment, int version)
Deprecated.
-
HttpCookie
public HttpCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path, long maxAge, boolean httpOnly, boolean secure, java.lang.String comment, int version, HttpCookie.SameSite sameSite)
Deprecated.
-
HttpCookie
public HttpCookie(java.lang.String setCookie)
Deprecated.
-
-
Method Detail
-
getName
public java.lang.String getName()
Deprecated.- Returns:
- the cookie name
-
getValue
public java.lang.String getValue()
Deprecated.- Returns:
- the cookie value
-
getComment
public java.lang.String getComment()
Deprecated.- Returns:
- the cookie comment
-
getDomain
public java.lang.String getDomain()
Deprecated.- Returns:
- the cookie domain
-
getMaxAge
public long getMaxAge()
Deprecated.- Returns:
- the cookie max age in seconds
-
getPath
public java.lang.String getPath()
Deprecated.- Returns:
- the cookie path
-
isSecure
public boolean isSecure()
Deprecated.- Returns:
- whether the cookie is valid for secure domains
-
getVersion
public int getVersion()
Deprecated.- Returns:
- the cookie version
-
getSameSite
public HttpCookie.SameSite getSameSite()
Deprecated.- Returns:
- the cookie SameSite enum attribute
-
isHttpOnly
public boolean isHttpOnly()
Deprecated.- Returns:
- whether the cookie is valid for the http protocol only
-
isExpired
public boolean isExpired(long timeNanos)
Deprecated.- Parameters:
timeNanos
- the time to check for cookie expiration, in nanoseconds- Returns:
- whether the cookie is expired by the given time
-
asString
public java.lang.String asString()
Deprecated.- Returns:
- a string representation of this cookie
-
getSetCookie
public java.lang.String getSetCookie(CookieCompliance compliance)
Deprecated.
-
getRFC2965SetCookie
public java.lang.String getRFC2965SetCookie()
Deprecated.
-
getRFC6265SetCookie
public java.lang.String getRFC6265SetCookie()
Deprecated.
-
isHttpOnlyInComment
public static boolean isHttpOnlyInComment(java.lang.String comment)
Deprecated.
-
getSameSiteFromComment
public static HttpCookie.SameSite getSameSiteFromComment(java.lang.String comment)
Deprecated.
-
getSameSiteDefault
public static HttpCookie.SameSite getSameSiteDefault(ServletContext context)
Deprecated.Get the default value for SameSite cookie attribute, if one has been set for the given context.- Parameters:
context
- the context to check for default SameSite value- Returns:
- the default SameSite value or null if one does not exist
- Throws:
java.lang.IllegalStateException
- if the default value is not a permitted value
-
getCommentWithoutAttributes
public static java.lang.String getCommentWithoutAttributes(java.lang.String comment)
Deprecated.
-
getCommentWithAttributes
public static java.lang.String getCommentWithAttributes(java.lang.String comment, boolean httpOnly, HttpCookie.SameSite sameSite)
Deprecated.
-
-