我取到了session id ,怎么才能,通过个session id 找到session ?
 有的朋友说通过重写url:http:ssss.ddd.ddd/ddd.faces?jsesessionid=desagesa1245d5s4fa24
 server端会自动找吗?或者,我在server端取到这个jsesessionid,再去找,那么,那个语句我要怎么写?

解决方案 »

  1.   

    你服务器端的话随便拿个session然后
    调用
     HttpSessionContext  getSessionContext()
              Deprecated. As of Version 2.1, this method is deprecated and has no replacement. It will be removed in a future version of the Java Servlet API.
    然后用
    HttpSessionContext  调用
    javax.servlet.http
    Interface HttpSessionContext
    你是客户端的话,cookie的优先级别高于url中的jsessionid=desagesa1245d5s4fa24。你需要修改
    你给服务器的cookie中的JSESSIONID为desagesa1245d5s4fa24
    -_-#你是客户端的话,怀疑你有不轨的企图
      

  2.   

    修改
    然后用
    HttpSessionContext  调用
    javax.servlet.http
    Interface HttpSessionContext 的
     HttpSession  getSession(java.lang.String sessionId)
              Deprecated. As of Java Servlet API 2.1 with no replacement. This method must return null and will be removed in a future version of this API.注意下整个方法和类都是Deprecated的