@Override
    public void saveTo(HttpServletRequest request, HttpServletResponse response) {

        String name = getName();
        String value = getValue();
        String comment = getComment();
        String domain = getDomain();
        String path = calculatePath(request);
        int maxAge = getMaxAge();
        int version = getVersion();
        boolean secure = isSecure();
        boolean httpOnly = isHttpOnly();
        SameSiteOptions sameSite = getSameSite();

        addCookieHeader(response, name, value, comment, domain, path, maxAge, version, secure, httpOnly, sameSite);
    }
Returns the Cookie's calculated path setting.  If the {@link javax.servlet.http.Cookie#getPath() path} is {@code null},
then the {@code request}'s {@link javax.servlet.http.HttpServletRequest#getContextPath() context path}
will be returned. If getContextPath() is the empty string or null then the ROOT_PATH constant is returned.

@param request the incoming HttpServletRequest
@return the path to be used as the path when the cookie is created or removed
web/src/main/java/org/apache/shiro/web/servlet/SimpleCookie.java