Hi everyone.
 
I've been having some trouble with HTTP sessions... if I invalidate a session, and then re-request a page (JSP, servlet)... or just re-call getSession(), the same ID is used.  The session is invalidated because all of the data is lost, however I don't think that when the client requests the same session ID, a new session should be assigned that same ID.  This code snippet (JSP) demonstrates the problem:
 
<%
out.println("Initial ID: " + session.getId() + "<br>");
session.putValue("test","test");
out.println("Test data: " + session.getValue("test") + "<br>");
session.invalidate();
session = request.getSession();
out.println("New ID: " + session.getId() + "<br>");
out.println("Test data: " + session.getValue("test") + "<br>");
%>
 
I've talked to one other person about this problem already, and he claims that it doesn't appear on his machine.  Anyone have any ideas why it's happening?!
 
Another problem: when I access pages on my local machine with MSIE, session information seems to be stored fine... however, in the servlet, although a call to isRequestedSessionIdFromCookie() confirms that a cookie is being used, the cookie is nowhere to be found in the Cookie array returned by getCookies().  It works normally from Netscape.  Again, any ideas?
 
stefan tryggvason

Reply via email to