The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

problem in session tracking -

Posted by saddy on May 17, 2001 at 5:12 PM

Hello friends,

Here are two JSP pages

First JSP Page
<%
session.setAttribute("attr",new String("It is Valid"));
String s = (String)session.getAttribute("attr");
out.println(s);
out.println(session.getId());
%>
next


Second JSP Page
<%
String s2 = (String)session.getAttribute("attr");
out.println(s2);
out.println(session.getId());
session.invalidate();
%>
prev


Now i have following doubts
1) why the attribute which was set in first page is not accesible in second
page although the same session is continuing( as it has same ID);

2) Even though the second page calls session.invalidate() the session does not terminates as if you press prev button the same session ID is displayed.


thanks in advance



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us