public.javadoc.org.spincast.core.cookies.CookieDefault.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
CookieDefault (org.spincast:spincast-framework 1.0.0 API)
org.spincast.core.cookies
Class CookieDefault
- java.lang.Object
-
- org.spincast.core.cookies.CookieDefault
-
-
Constructor Summary
Constructors
Constructor and Description
CookieDefault(String name,
SpincastConfig spincastConfig)
Constructor
CookieDefault(String name,
String value,
SpincastConfig spincastConfig)
Constructor
CookieDefault(String name,
String value,
String path,
String domain,
Date expires,
boolean secure,
boolean httpOnly,
CookieSameSite cookieSameSite,
boolean discard,
int version,
SpincastConfig spincastConfig)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
String
getDomain()
Gets the cookie domain.
Date
getExpires()
Gets the date the cookie will expire at.
String
getName()
Gets the cookie name.
String
getPath()
Gets the cookie path.
CookieSameSite
getSameSite()
The "sameSite" attribute.
String
getValue()
Gets the cookie value.
int
getVersion()
Gets the cookie version.
boolean
isDiscard()
Is this cookie to be discarded?
boolean
isExpired()
Is this cookie expired?
boolean
isHttpOnly()
Is the cookie availableto the server
and not to javascript?
boolean
isSecure()
Is the "secure" feature on?
void
setDomain(String domain)
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
setPath(String path)
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
setValue(String value)
Sets the cookie value.
String
toString()
-
-
Constructor Detail
-
CookieDefault
public CookieDefault(String name,
SpincastConfig spincastConfig)
Constructor
-
CookieDefault
public CookieDefault(String name,
String value,
SpincastConfig spincastConfig)
Constructor
-
Method Detail
-
setValue
public void setValue(String value)
Description copied from interface: Cookie
Sets the cookie value.
-
setPath
public void setPath(String path)
Description copied from interface: Cookie
Sets the cookie path.
-
getDomain
public String getDomain()
Description copied from interface: Cookie
Gets the cookie domain.
-
setDomain
public void setDomain(String domain)
Description copied from interface: Cookie
Sets the cookie domain.
-
getExpires
public Date 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.
If null
the cookie will live for the current session
(this is the default).
- Specified by:
getExpires
in interface Cookie
-
setExpires
public void setExpires(Date expires)
Description copied from interface: Cookie
Sets the date the cookie will expire.
If the date is in the past, the cookie will be deleted.
If null
the cookie will live for the current session
(this is the default).
- Specified by:
setExpires
in interface Cookie
-
setExpiresUsingMaxAge
public void setExpiresUsingMaxAge(int maxAge)
Description copied from interface: Cookie
Sets the number of seconds for a cookie to live.
If maxAge
< 0 : The "Expires date" will be in the past and the cookie will
therefore be deleted.
If maxAge
== 0 : The "Expires date" will be null
and the cookie will live
for the session only.
If maxAge
> 0 : The "Expires date" will be the current date + 'maxAge'
seconds.
- Specified by:
setExpiresUsingMaxAge
in interface Cookie
-
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 interface Cookie
-
getSameSite
public CookieSameSite getSameSite()
Description copied from interface: Cookie
The "sameSite" attribute. May be
null
to not add it at all.
- Specified by:
getSameSite
in interface Cookie
-
setSameSite
public void setSameSite(CookieSameSite cookieSameSite)
Description copied from interface: Cookie
The "sameSite" attribute to add.
- Specified by:
setSameSite
in interface Cookie
-
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 interface Cookie
-
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 interface Cookie
Copyright © 2019. All rights reserved.