Package org.apache.shiro.web.servlet
Interface Cookie
- All Known Implementing Classes:
SimpleCookie
public interface Cookie
Interface 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 the
2.4 and 2.5 API (Servlet API 'native' support was only introduced in
the 2.6 specification).- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe 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 -
Method Summary
Modifier and TypeMethodDescriptionintgetName()getPath()getValue()intbooleanbooleanisSecure()readValue(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) voidvoidsetHttpOnly(boolean httpOnly) voidsetMaxAge(int maxAge) voidvoidvoidsetSameSite(Cookie.SameSiteOptions sameSite) voidsetSecure(boolean secure) voidvoidsetVersion(int version)
-
Field Details
-
DELETED_COOKIE_VALUE
The value of deleted cookie (with the maxAge 0).- See Also:
-
ONE_YEAR
The number of seconds in one year (= 60 * 60 * 24 * 365).- See Also:
-
ROOT_PATH
Root path to use when the path hasn't been set and request context root is empty or null.- See Also:
-
-
Method Details
-
getName
-
setName
-
getValue
-
setValue
-
getComment
-
setComment
-
getDomain
-
setDomain
-
getMaxAge
int getMaxAge() -
setMaxAge
-
getPath
-
setPath
-
isSecure
boolean isSecure() -
setSecure
-
getVersion
int getVersion() -
setVersion
-
setHttpOnly
-
isHttpOnly
boolean isHttpOnly() -
setSameSite
-
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
-