public class SameSiteCookiesFilter extends HttpFilter
Set-Cookie
headers with a SameSite=None
attribute
for each shared cookie and each path of delegated UIs and previews of the product.
This filter aims at filtering only the paths on which a login form is involved, where a session cookie (or more generally a shared cookie) is created. The application administrator has the capability to extend the scope of the filter through a dedicated setting, so that all paths of the application are filtered. This is notably useful if a given customer is using a custom login page (with a dedicated path), which cannot be natively declared by the filter.
Here are the steps to correctly use this filter:
<url-pattern>
.<init-param>
with "loginPaths"
as parameter name and a comma-separated value.SameSiteCookies
class.Here is an extract of filter declaration:
<url-pattern>/*</url-pattern> <init-param> <param-name>loginPaths</param-name> <param-value>/path1/login.jsp,/path2/other-login</param-value> </init-param>
SameSiteCookies
Constructor and Description |
---|
SameSiteCookiesFilter() |
Modifier and Type | Method and Description |
---|---|
protected void |
doFilter(HttpServletRequest request,
HttpServletResponse response,
FilterChain chain)
Processes this filter and either executes or blocks the chain.
|
void |
init(FilterConfig filterConfig)
This implementation does nothing.
|
destroy, doFilter, handleOslcError
public void init(FilterConfig filterConfig) throws ServletException
HttpFilter
init
in interface Filter
init
in class HttpFilter
filterConfig
- the configuration of the filter.ServletException
- not thrown by this implementation.protected void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException
HttpFilter
Subclasses may throw a OslcWebApplicationException
to report an OslcError
.
This filter will automatically serialize such error in the HTTP response.
doFilter
in class HttpFilter
request
- the request.response
- the response.chain
- the filter chain to process.IOException
- if an I/O error occurs.ServletException
- if the filter execution fails.