tomcat からコードを読むと、次のことがわかります。
// Always set secure if the request is secure
if (scc.isSecure() || secure) {
    cookie.setSecure(true);
}
sessionCookieConfig.setSecure(false);そのため、リスナーまたは<cookie-config><secure>false</secure></cookie-config>web.xmlで JSESSIONID Cookie のセキュア フラグを非アクティブ化しようとしても、Tomcat がセキュア フラグを true に強制するため、リクエストがセキュアな場合 (つまり、https URL または SSL ポートから来た場合) は機能しません。
解決策は、リクエスト フィルタを使用して、セッションの作成直後にサーバー レスポンスの JSESSIONID Cookie を変更することです。これは私の実装です(非常に基本的です):
public class DisableSecureCookieFilter implements javax.servlet.Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException { }
    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        if(request instanceof HttpServletRequest && response instanceof HttpServletResponse) {
            request = new ForceUnsecureSessionCookieRequestWrapper((HttpServletRequest) request, (HttpServletResponse) response);
        }
        chain.doFilter(request, response);
    }
    @Override
    public void destroy() { }
    public static class ForceUnsecureSessionCookieRequestWrapper extends HttpServletRequestWrapper {
        HttpServletResponse response;
        public ForceUnsecureSessionCookieRequestWrapper(HttpServletRequest request, HttpServletResponse response) {
            super(request);
            this.response = response;
        }
        @Override
        public HttpSession getSession(boolean create) {
            if(create) {
                HttpSession session = super.getSession(create);
                updateCookie(response.getHeaders("Set-Cookie"));
                return session;
            }
            return super.getSession(create);
        }
        @Override
        public HttpSession getSession() {
            HttpSession session = super.getSession();
            if(session != null) {
                updateCookie(response.getHeaders("Set-Cookie"));
            }
            return session;
        }
        protected void updateCookie(Collection<String> cookiesAfterCreateSession) {
            if(cookiesAfterCreateSession != null && !response.isCommitted()) {
                // search if a cookie JSESSIONID Secure exists
                Optional<String> cookieJSessionId = cookiesAfterCreateSession.stream()
                                                        .filter(cookie -> cookie.startsWith("JSESSIONID") && cookie.contains("Secure"))
                                                        .findAny();
                if(cookieJSessionId.isPresent()) {
                    // remove all Set-Cookie and add the unsecure version of the JSessionId Cookie
                    response.setHeader("Set-Cookie", cookieJSessionId.get().replace("Secure", ""));
                    // re-add all other Cookies
                    cookiesAfterCreateSession.stream()
                            .filter(cookie -> !cookie.startsWith("JSESSIONID"))
                            .forEach(cookie -> response.addHeader("Set-Cookie", cookie));
                }
            }
        }
    }
}
および web.xml で:
<filter>
    <filter-name>disableSecureCookieFilter</filter-name>
    <filter-class>com.xxxx.security.DisableSecureCookieFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>disableSecureCookieFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
安全でない Cookie を有効にすると、重要な https セキュリティがバイパスされることに注意してください。(http から https へのスムーズな移行のために、これを行う必要がありました)