Package org.spincast.core.cookies
Class CookieDefault
java.lang.Object
org.spincast.core.cookies.CookieDefault
- All Implemented Interfaces:
Cookie
-
Constructor Summary
ConstructorDescriptionCookieDefault
(String name, String value, String path, String domain, Date expires, boolean secure, boolean httpOnly, CookieSameSite cookieSameSite, boolean discard, int version, SpincastConfig spincastConfig) ConstructorCookieDefault
(String name, String value, SpincastConfig spincastConfig) ConstructorCookieDefault
(String name, SpincastConfig spincastConfig) Constructor -
Method Summary
Modifier and TypeMethodDescriptionGets the cookie domain.Gets the date the cookie will expire at.getName()
Gets the cookie name.getPath()
Gets the cookie path.The "sameSite" attribute.getValue()
Gets the cookie value.int
Gets the cookie version.boolean
Is this cookie to be discarded?boolean
Is this cookie expired?boolean
Is the cookie availableto the server and not to javascript?boolean
isSecure()
Is the "secure" feature on?void
Sets the cookie domain.void
setExpires
(Date expires) Sets the date the cookie will expire.void
setExpiresUsingMaxAge
(int maxAge) Sets the number of seconds for a cookie to live.void
setHttpOnly
(boolean httpOnly) Sets if the cookie is available only for to the server anbd not to javascript.void
Sets the cookie path.void
setSameSite
(CookieSameSite cookieSameSite) The "sameSite" attribute to add.void
setSecure
(boolean secure) Sets the "secure" feature on or off.void
Sets the cookie value.toString()
-
Constructor Details
-
CookieDefault
Constructor -
CookieDefault
Constructor -
CookieDefault
public CookieDefault(String name, String value, @Nullable String path, @Nullable String domain, @Nullable Date expires, boolean secure, boolean httpOnly, @Nullable CookieSameSite cookieSameSite, boolean discard, int version, SpincastConfig spincastConfig) Constructor
-
-
Method Details
-
getValue
Description copied from interface:Cookie
Gets the cookie value. -
setValue
Description copied from interface:Cookie
Sets the cookie value. -
getPath
Description copied from interface:Cookie
Gets the cookie path. -
setPath
Description copied from interface:Cookie
Sets the cookie path. -
getDomain
Description copied from interface:Cookie
Gets the cookie domain. -
setDomain
Description copied from interface:Cookie
Sets the cookie domain. -
getExpires
Description copied from interface:Cookie
Gets the date the cookie will expire at. If the date is in the past, the cookie will be deleted. Ifnull
the cookie will live for the current session (this is the default).- Specified by:
getExpires
in interfaceCookie
-
setExpires
Description copied from interface:Cookie
Sets the date the cookie will expire. If the date is in the past, the cookie will be deleted. Ifnull
the cookie will live for the current session (this is the default).- Specified by:
setExpires
in interfaceCookie
-
setExpiresUsingMaxAge
public void setExpiresUsingMaxAge(int maxAge) Description copied from interface:Cookie
Sets the number of seconds for a cookie to live. IfmaxAge
< 0 : The "Expires date" will be in the past and the cookie will therefore be deleted. IfmaxAge
== 0 : The "Expires date" will benull
and the cookie will live for the session only. IfmaxAge
> 0 : The "Expires date" will be the current date +'maxAge'
seconds.- Specified by:
setExpiresUsingMaxAge
in interfaceCookie
-
isExpired
public boolean isExpired()Description copied from interface:Cookie
Is this cookie expired? -
isSecure
public boolean isSecure()Description copied from interface:Cookie
Is the "secure" feature on? -
setSecure
public void setSecure(boolean secure) Description copied from interface:Cookie
Sets the "secure" feature on or off. -
isHttpOnly
public boolean isHttpOnly()Description copied from interface:Cookie
Is the cookie availableto the server and not to javascript?- Specified by:
isHttpOnly
in interfaceCookie
-
getSameSite
Description copied from interface:Cookie
The "sameSite" attribute. May benull
to not add it at all.- Specified by:
getSameSite
in interfaceCookie
-
setSameSite
Description copied from interface:Cookie
The "sameSite" attribute to add.- Specified by:
setSameSite
in interfaceCookie
-
setHttpOnly
public void setHttpOnly(boolean httpOnly) Description copied from interface:Cookie
Sets if the cookie is available only for to the server anbd not to javascript.- Specified by:
setHttpOnly
in interfaceCookie
-
getName
Description copied from interface:Cookie
Gets the cookie name. -
isDiscard
public boolean isDiscard()Description copied from interface:Cookie
Is this cookie to be discarded? -
getVersion
public int getVersion()Description copied from interface:Cookie
Gets the cookie version.- Specified by:
getVersion
in interfaceCookie
-
toString
-