Best way for allowing subdomain session cookies using Tomcat

后端 未结 5 1533
攒了一身酷
攒了一身酷 2020-12-04 19:52

By default tomcat will create a session cookie for the current domain.

If you are on www.example.com, your cookie will be created for www.example.com (will only work

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-04 20:22

    I've run into this at $DAYJOB. In my case I wanted to implement SSL signon then redirect to a non SSL page. The core problem in tomcat is the method (from memory) SessionManager.configureSessionCookie which hard codes all the variables you would like to get access to.

    I came up with a few ideas, including a particularly egregious hack using mod_headers in apache to rewrite the cookie based on regex substitution.

    The definative way to solve this would be to submit a patch to the tomcat developers that adds configurable parameters to the SessionManager class.

提交回复
热议问题