用户登录
用户注册

分享至

jsp 二级域名共享session

  • 作者: 亖呉?盀
  • 来源: 51数据库
  • 2021-09-04
protected void configureSessionCookie(Cookie cookie) {  

        cookie.setMaxAge(-1);  

        String contextPath = null;  

        if (!connector.getEmptySessionPath() && (getContext() != null)) {  

            contextPath = getContext().getEncodedPath();  

        }  www.2cto.com

        if ((contextPath != null) && (contextPath.length() > 0)) {  

            cookie.setPath(contextPath);  

        } else {  

            cookie.setPath("/");  

        }  

          

        <span style="color: #ff0000;">cookie.setDomain("xxx.com");</span>  

          

        if (isSecure()) {  

            cookie.setSecure(true);  

        }  

    }  

  

...  

软件
前端设计
程序设计
Java相关