Package org.apache.shiro.web.servlet
Interface Cookie
-
- All Known Implementing Classes:
SimpleCookie
public interface CookieInterface representing HTTP cookie operations, supporting pojo-style getters and setters for all attributes which includes HttpOnly support. This allows Shiro to set HttpOnly cookies even on Servlet containers based on the2.4and2.5API (Servlet API 'native' support was only introduced in the2.6specification).- Since:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classCookie.SameSiteOptionsThe SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context.
-
Field Summary
Fields Modifier and Type Field Description static StringDELETED_COOKIE_VALUEThe value of deleted cookie (with the maxAge 0).static intONE_YEARThe number of seconds in one year (= 60 * 60 * 24 * 365).static StringROOT_PATHRoot path to use when the path hasn't been set and request context root is empty or null.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetComment()StringgetDomain()intgetMaxAge()StringgetName()StringgetPath()Cookie.SameSiteOptionsgetSameSite()StringgetValue()intgetVersion()booleanisHttpOnly()booleanisSecure()StringreadValue(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voidremoveFrom(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voidsaveTo(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voidsetComment(String comment)voidsetDomain(String domain)voidsetHttpOnly(boolean httpOnly)voidsetMaxAge(int maxAge)voidsetName(String name)voidsetPath(String path)voidsetSameSite(Cookie.SameSiteOptions sameSite)voidsetSecure(boolean secure)voidsetValue(String value)voidsetVersion(int version)
-
-
-
Field Detail
-
DELETED_COOKIE_VALUE
static final String DELETED_COOKIE_VALUE
The value of deleted cookie (with the maxAge 0).- See Also:
- Constant Field Values
-
ONE_YEAR
static final int ONE_YEAR
The number of seconds in one year (= 60 * 60 * 24 * 365).- See Also:
- Constant Field Values
-
ROOT_PATH
static final String ROOT_PATH
Root path to use when the path hasn't been set and request context root is empty or null.- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
String getName()
-
setName
void setName(String name)
-
getValue
String getValue()
-
setValue
void setValue(String value)
-
getComment
String getComment()
-
setComment
void setComment(String comment)
-
getDomain
String getDomain()
-
setDomain
void setDomain(String domain)
-
getMaxAge
int getMaxAge()
-
setMaxAge
void setMaxAge(int maxAge)
-
getPath
String getPath()
-
setPath
void setPath(String path)
-
isSecure
boolean isSecure()
-
setSecure
void setSecure(boolean secure)
-
getVersion
int getVersion()
-
setVersion
void setVersion(int version)
-
setHttpOnly
void setHttpOnly(boolean httpOnly)
-
isHttpOnly
boolean isHttpOnly()
-
setSameSite
void setSameSite(Cookie.SameSiteOptions sameSite)
-
getSameSite
Cookie.SameSiteOptions getSameSite()
-
saveTo
void saveTo(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
removeFrom
void removeFrom(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
readValue
String readValue(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
-