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 Details

    • enabled

      protected boolean enabled
    • cookieName

      protected String cookieName
    • cookieDomain

      protected String cookieDomain
    • cookiePath

      protected String 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:
      postHandle in interface org.springframework.web.servlet.HandlerInterceptor