Package org.spincast.core.cookies
Class CookieDefault
java.lang.Object
org.spincast.core.cookies.CookieDefault
- All Implemented Interfaces:
Cookie
-
Constructor Summary
ConstructorsConstructorDescriptionCookieDefault(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.intGets the cookie version.booleanIs this cookie to be discarded?booleanIs this cookie expired?booleanIs the cookie availableto the server and not to javascript?booleanisSecure()Is the "secure" feature on?voidSets the cookie domain.voidsetExpires(Date expires) Sets the date the cookie will expire.voidsetExpiresUsingMaxAge(int maxAge) Sets the number of seconds for a cookie to live.voidsetHttpOnly(boolean httpOnly) Sets if the cookie is available only for to the server anbd not to javascript.voidSets the cookie path.voidsetSameSite(CookieSameSite cookieSameSite) The "sameSite" attribute to add.voidsetSecure(boolean secure) Sets the "secure" feature on or off.voidSets 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:CookieGets the cookie value. -
setValue
Description copied from interface:CookieSets the cookie value. -
getPath
Description copied from interface:CookieGets the cookie path. -
setPath
Description copied from interface:CookieSets the cookie path. -
getDomain
Description copied from interface:CookieGets the cookie domain. -
setDomain
Description copied from interface:CookieSets the cookie domain. -
getExpires
Description copied from interface:CookieGets the date the cookie will expire at. If the date is in the past, the cookie will be deleted. Ifnullthe cookie will live for the current session (this is the default).- Specified by:
getExpiresin interfaceCookie
-
setExpires
Description copied from interface:CookieSets the date the cookie will expire. If the date is in the past, the cookie will be deleted. Ifnullthe cookie will live for the current session (this is the default).- Specified by:
setExpiresin interfaceCookie
-
setExpiresUsingMaxAge
public void setExpiresUsingMaxAge(int maxAge) Description copied from interface:CookieSets 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 benulland the cookie will live for the session only. IfmaxAge> 0 : The "Expires date" will be the current date +'maxAge'seconds.- Specified by:
setExpiresUsingMaxAgein interfaceCookie
-
isExpired
public boolean isExpired()Description copied from interface:CookieIs this cookie expired? -
isSecure
public boolean isSecure()Description copied from interface:CookieIs the "secure" feature on? -
setSecure
public void setSecure(boolean secure) Description copied from interface:CookieSets the "secure" feature on or off. -
isHttpOnly
public boolean isHttpOnly()Description copied from interface:CookieIs the cookie availableto the server and not to javascript?- Specified by:
isHttpOnlyin interfaceCookie
-
getSameSite
Description copied from interface:CookieThe "sameSite" attribute. May benullto not add it at all.- Specified by:
getSameSitein interfaceCookie
-
setSameSite
Description copied from interface:CookieThe "sameSite" attribute to add.- Specified by:
setSameSitein interfaceCookie
-
setHttpOnly
public void setHttpOnly(boolean httpOnly) Description copied from interface:CookieSets if the cookie is available only for to the server anbd not to javascript.- Specified by:
setHttpOnlyin interfaceCookie
-
getName
Description copied from interface:CookieGets the cookie name. -
isDiscard
public boolean isDiscard()Description copied from interface:CookieIs this cookie to be discarded? -
getVersion
public int getVersion()Description copied from interface:CookieGets the cookie version.- Specified by:
getVersionin interfaceCookie
-
toString
-