public.javadoc.org.spincast.core.cookies.Cookie.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.
Cookie (org.spincast:spincast-framework 1.0.0 API)
org.spincast.core.cookies
Interface Cookie
-
- All Known Implementing Classes:
- CookieDefault
public interface Cookie
An HTTP cookie.
-
-
Method Summary
All Methods Instance Methods Abstract 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 sameSite)
The "sameSite" attribute to add.
void
setSecure(boolean secure)
Sets the "secure" feature on or off.
void
setValue(String value)
Sets the cookie value.
-
-
Method Detail
-
getName
String getName()
Gets the cookie name.
-
getValue
String getValue()
Gets the cookie value.
-
setValue
void setValue(String value)
Sets the cookie value.
-
getPath
String getPath()
Gets the cookie path.
-
setPath
void setPath(String path)
Sets the cookie path.
-
getDomain
String getDomain()
Gets the cookie domain.
-
setDomain
void setDomain(String domain)
Sets the cookie domain.
-
getExpires
Date getExpires()
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).
-
setExpires
void setExpires(Date expires)
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).
-
setExpiresUsingMaxAge
void setExpiresUsingMaxAge(int maxAge)
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.
-
isExpired
boolean isExpired()
Is this cookie expired?
-
isSecure
boolean isSecure()
Is the "secure" feature on?
-
setSecure
void setSecure(boolean secure)
Sets the "secure" feature on or off.
-
isHttpOnly
boolean isHttpOnly()
Is the cookie availableto the server
and not to javascript?
-
setHttpOnly
void setHttpOnly(boolean httpOnly)
Sets if the cookie is available only for to the server
anbd not to javascript.
-
getSameSite
CookieSameSite getSameSite()
The "sameSite" attribute. May be
null
to not add it at all.
-
setSameSite
void setSameSite(CookieSameSite sameSite)
The "sameSite" attribute to add.
-
isDiscard
boolean isDiscard()
Is this cookie to be discarded?
-
getVersion
int getVersion()
Gets the cookie version.
Copyright © 2019. All rights reserved.