• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session invalidate?

 
Yu Chen
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens to a session if the containter is shutdown and then brought up again?
Thanks.
-yu chen
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you kept the session id (through cookies) you can maintain the session. Try this experiment with Tomcat4:
// a.jsp
<%
session.setAttribute("test", "HI");
%>
<%= session.getId() %>
//b.jsp
<%= (String) session.getAttribute("test") %>
Put them in your webapp and access a.jsp. Note and copy the sessionid displayed. Kill the browser and restart Tomcat4.
Access b.jsp and attach jsessionid={whatever sessionid you got} to the URL, e.g
http://localhost:8080/myContext/b.jsp;jsessionid=0B1816DE194C7A3E78F962B16052F79E
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic