Package io.micronaut.http.simple.cookies
Class SimpleCookie
java.lang.Object
io.micronaut.http.simple.cookies.SimpleCookie
- All Implemented Interfaces:
Cookie
,Serializable
,Comparable<Cookie>
Simple
Cookie
implementation.- Since:
- 1.0
- Author:
- Vladimir Orany
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Sets the domain of the cookie.boolean
Gets the domain name of this Cookie.long
getName()
getPath()
The path of the cookie.Checks to see if thisCookie
can be sent along cross-site requests.getValue()
int
hashCode()
httpOnly
(boolean httpOnly) Sets whether the cookie is HTTP-Only.boolean
Checks to see if thisCookie
can only be accessed via HTTP.boolean
isSecure()
maxAge
(long maxAge) Sets the max age of the cookie in seconds.Sets the path of the cookie.Determines if thisCookie
can be sent along cross-site requests.secure
(boolean secure) Sets whether the cookie is secure.toString()
Sets the value.
-
Constructor Details
-
SimpleCookie
Constructor.- Parameters:
name
- The namevalue
- The value
-
-
Method Details
-
getName
-
getValue
-
getDomain
Description copied from interface:Cookie
Gets the domain name of this Cookie.Domain names are formatted according to RFC 2109.
-
getPath
Description copied from interface:Cookie
The path of the cookie. The cookie is visible to all paths below the request path on the server. -
isHttpOnly
public boolean isHttpOnly()Description copied from interface:Cookie
Checks to see if thisCookie
can only be accessed via HTTP. If this returns true, theCookie
cannot be accessed through client side script - But only if the browser supports it.See here for reference
- Specified by:
isHttpOnly
in interfaceCookie
- Returns:
- True if this
Cookie
is HTTP-only or false if it isn't
-
isSecure
public boolean isSecure() -
getMaxAge
public long getMaxAge() -
getSameSite
Description copied from interface:Cookie
Checks to see if thisCookie
can be sent along cross-site requests. For more information, please look here- Specified by:
getSameSite
in interfaceCookie
- Returns:
- The SameSite attribute of the cookie
-
sameSite
Description copied from interface:Cookie
-
maxAge
Description copied from interface:Cookie
Sets the max age of the cookie in seconds. -
value
Description copied from interface:Cookie
Sets the value. -
domain
Description copied from interface:Cookie
Sets the domain of the cookie. -
path
Description copied from interface:Cookie
Sets the path of the cookie. -
secure
Description copied from interface:Cookie
Sets whether the cookie is secure. -
httpOnly
Description copied from interface:Cookie
Sets whether the cookie is HTTP-Only. -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Cookie>
-
hashCode
public int hashCode() -
toString
-