Class InformationCookie
java.lang.Object
ch.tocco.nice2.web.core.api.servlet.AbstractNiceCookie
ch.tocco.nice2.web.core.api.servlet.JwtCookie<List<InformationCookieContribution.NamedInformation>>
ch.tocco.nice2.web.core.api.servlet.InformationCookie
public class InformationCookie
extends JwtCookie<List<InformationCookieContribution.NamedInformation>>
Implements the nice_info cookie.
Any values configured in InformationCookieContribution
will be set as a claim
inside a JWT that has been signed with the given secret.
-
Field Summary
Fields inherited from class ch.tocco.nice2.web.core.api.servlet.AbstractNiceCookie
addedToResponse, content, expires, sameSiteMode, secure
-
Constructor Summary
ConstructorDescriptionInformationCookie
(List<InformationCookieContribution.NamedInformation> information, String secret, int timeToLive, String originDomain) -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getDeletionString
(String host) Returns a plain string that can be used to direct the browser to delete this cookie.protected String
getName()
protected void
setClaims
(List<InformationCookieContribution.NamedInformation> information, BiConsumer<String, Object> claimConsumer) Methods inherited from class ch.tocco.nice2.web.core.api.servlet.JwtCookie
generateJwt, getSpecificTokens
Methods inherited from class ch.tocco.nice2.web.core.api.servlet.AbstractNiceCookie
addToResponse, setExpires, verifyConfiguration
-
Field Details
-
NAME
- See Also:
-
HEADER_PATTERN
-
-
Constructor Details
-
InformationCookie
public InformationCookie(List<InformationCookieContribution.NamedInformation> information, String secret, int timeToLive, String originDomain)
-
-
Method Details
-
getDeletionString
Returns a plain string that can be used to direct the browser to delete this cookie. -
getName
- Specified by:
getName
in classAbstractNiceCookie
-
setClaims
protected void setClaims(List<InformationCookieContribution.NamedInformation> information, BiConsumer<String, Object> claimConsumer) - Specified by:
setClaims
in classJwtCookie<List<InformationCookieContribution.NamedInformation>>
-