Quantcast
Channel: CSDN博客推荐文章
Viewing all articles
Browse latest Browse all 35570

jsp 二级域名共享session

$
0
0
  1. protected void configureSessionCookie(Cookie cookie) {  
  2.         cookie.setMaxAge(-1);  
  3.         String contextPath = null;  
  4.         if (!connector.getEmptySessionPath() && (getContext() != null)) {  
  5.             contextPath = getContext().getEncodedPath();  
  6.         }  
  7.         if ((contextPath != null) && (contextPath.length() > 0)) {  
  8.             cookie.setPath(contextPath);  
  9.         } else {  
  10.             cookie.setPath("/");  
  11.         }  
  12.           
  13.         <span style="color: #ff0000;">cookie.setDomain("xxx.com");</span>  
  14.           
  15.         if (isSecure()) {  
  16.             cookie.setSecure(true);  
  17.         }  
  18.     }  
  19.   
  20. ...  
作者:hfmbook 发表于2013-2-1 15:39:03 原文链接
阅读:50 评论:0 查看评论

Viewing all articles
Browse latest Browse all 35570

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>