Class SiteCookieChangeInterceptor
java.lang.Object
org.craftercms.engine.servlet.interceptor.SiteCookieChangeInterceptor
- All Implemented Interfaces:
org.springframework.web.servlet.HandlerInterceptor
public class SiteCookieChangeInterceptor
extends Object
implements org.springframework.web.servlet.HandlerInterceptor
Handler interceptor that will set the site cookie whenever the cookie is missing or the current site is different
that the cookie value. Use in conjunction with
CookieSiteResolver
when you want to set up simple multi tenancy.- Author:
- avasquez
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSiteCookieChangeInterceptor(boolean enabled, String cookieName, String cookieDomain, String cookiePath, int cookieMaxAge, boolean httpOnly, boolean secure) -
Method Summary
Modifier and TypeMethodDescriptionvoidpostHandle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object handler, org.springframework.web.servlet.ModelAndView modelAndView) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.servlet.HandlerInterceptor
afterCompletion, preHandle
-
Field Details
-
enabled
protected boolean enabled -
cookieName
-
cookieDomain
-
cookiePath
-
cookieMaxAge
protected int cookieMaxAge -
httpOnly
protected boolean httpOnly -
secure
protected boolean secure
-
-
Constructor Details
-
SiteCookieChangeInterceptor
@ConstructorProperties({"enabled","cookieName","cookieDomain","cookiePath","cookieMaxAge","httpOnly","secure"}) public SiteCookieChangeInterceptor(boolean enabled, String cookieName, String cookieDomain, String cookiePath, int cookieMaxAge, boolean httpOnly, boolean secure)
-
-
Method Details
-
postHandle
public void postHandle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object handler, org.springframework.web.servlet.ModelAndView modelAndView) - Specified by:
postHandlein interfaceorg.springframework.web.servlet.HandlerInterceptor
-