Interface CookieSerializer
- All Known Implementing Classes:
DefaultCookieSerializer
public interface CookieSerializer
Strategy for reading and writing a cookie value to the
HttpServletResponse
.- Since:
- 1.1
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Contains the information necessary to write a value to theHttpServletResponse
. -
Method Summary
Modifier and TypeMethodDescriptionreadCookieValues
(jakarta.servlet.http.HttpServletRequest request) Reads all the matching cookies from theHttpServletRequest
.void
writeCookieValue
(CookieSerializer.CookieValue cookieValue) Writes a givenCookieSerializer.CookieValue
to the providedHttpServletResponse
.
-
Method Details
-
writeCookieValue
Writes a givenCookieSerializer.CookieValue
to the providedHttpServletResponse
.- Parameters:
cookieValue
- theCookieSerializer.CookieValue
to write toCookieSerializer.CookieValue.getResponse()
. Cannot be null.
-
readCookieValues
Reads all the matching cookies from theHttpServletRequest
. The result is a List since there can be multipleCookie
in a single request with a matching name. For example, one Cookie may have a path of / and another of /context, but the path is not transmitted in the request.- Parameters:
request
- theHttpServletRequest
to read the cookie from. Cannot be null.- Returns:
- the values of all the matching cookies
-