当前位置:编程学习 > JS >>

jsp 二级域名共享session

protected void configureSessionCookie(Cookie cookie) {  
        cookie.setMaxAge(-1);  
        String contextPath = null;  
        if (!connector.getEmptySessionPath() && (getContext() != null)) {  
            contextPath = getContext().getEncodedPath();  
        }  www.zzzyk.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);  
        }  
    }  
  
...  
补充:Web开发 , Jsp ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,