Class AbstractCookieConfiguration
java.lang.Object
io.micronaut.security.oauth2.endpoint.AbstractCookieConfiguration
- All Implemented Interfaces:
io.micronaut.http.cookie.CookieConfiguration
- Direct Known Subclasses:
CookieNoncePersistenceConfiguration,CookiePkcePersistenceConfiguration,CookieStatePersistenceConfiguration
public abstract class AbstractCookieConfiguration
extends Object
implements io.micronaut.http.cookie.CookieConfiguration
Base configuration for
CookieConfiguration implementations.- Author:
- Álvaro Sánchez-Mariscal
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract String@NonNull StringbooleanWhether the cookie is a session cookie.voidsetCookieDomain(@Nullable String cookieDomain) Sets the domain name of this Cookie.voidsetCookieHttpOnly(Boolean cookieHttpOnly) Whether the Cookie can only be accessed via HTTP.voidsetCookieMaxAge(Duration cookieMaxAge) Sets the maximum age of the cookie.voidsetCookieName(@NonNull String cookieName) Cookie Name.voidsetCookiePath(@Nullable String cookiePath) Sets the path of the cookie.voidsetCookieSecure(Boolean cookieSecure) Sets whether the cookie is secured.voidsetSessionCookie(boolean sessionCookie) Whether the cookie is a session cookie.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.http.cookie.CookieConfiguration
getCookieSameSite
-
Field Details
-
cookieDomain
-
cookieSecure
-
cookiePath
-
cookieHttpOnly
-
cookieMaxAge
-
cookieName
-
sessionCookie
protected boolean sessionCookie
-
-
Constructor Details
-
AbstractCookieConfiguration
public AbstractCookieConfiguration()
-
-
Method Details
-
isSessionCookie
public boolean isSessionCookie()Whether the cookie is a session cookie. A session cookie does not have an expiration date. `cookie-max-age` is ignored if session cookie is set to true. Default value (false).- Returns:
- whether the cookie is a session cookie. A session cookie does not have an expiration date. If set to true, then
CookieConfiguration.getCookieMaxAge()is ignored. - Since:
- 4.12.0
-
setSessionCookie
public void setSessionCookie(boolean sessionCookie) Whether the cookie is a session cookie. A session cookie does not have an expiration date. `cookie-max-age` is ignored if session cookie is set to true. Default value (false).- Parameters:
sessionCookie- Whether the cookie is a session cookie.- Since:
- 4.12.0
-
getCookieDomain
- Specified by:
getCookieDomainin interfaceio.micronaut.http.cookie.CookieConfiguration
-
setCookieDomain
Sets the domain name of this Cookie. Default value (null).- Parameters:
cookieDomain- the domain name of this Cookie
-
isCookieSecure
- Specified by:
isCookieSecurein interfaceio.micronaut.http.cookie.CookieConfiguration
-
setCookieSecure
Sets whether the cookie is secured. Defaults to the secure status of the request.- Parameters:
cookieSecure- True if the cookie is secure
-
getCookieName
- Specified by:
getCookieNamein interfaceio.micronaut.http.cookie.CookieConfiguration
-
setCookieName
Cookie Name.- Parameters:
cookieName- Cookie name
-
defaultCookieName
-
getCookiePath
- Specified by:
getCookiePathin interfaceio.micronaut.http.cookie.CookieConfiguration
-
setCookiePath
Sets the path of the cookie. Default value ("/").- Parameters:
cookiePath- The path of the cookie.
-
isCookieHttpOnly
- Specified by:
isCookieHttpOnlyin interfaceio.micronaut.http.cookie.CookieConfiguration
-
setCookieHttpOnly
Whether the Cookie can only be accessed via HTTP. Default value (true).- Parameters:
cookieHttpOnly- Whether the Cookie can only be accessed via HTTP
-
getCookieMaxAge
- Specified by:
getCookieMaxAgein interfaceio.micronaut.http.cookie.CookieConfiguration
-
setCookieMaxAge
Sets the maximum age of the cookie. Default value (5 minutes).- Parameters:
cookieMaxAge- The maximum age of the cookie
-