Kesav Kumar
Software Engineer
Voquette, Inc.
650 356 3740
mailto:[EMAIL PROTECTED]
http://www.voquette.com
Voquette...Delivering Sound Information
-----Original Message-----
From: Jason Coward [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 2:55 PM
To: Orion-Interest
Subject: RE: Session Invalidate ExceptionKesav:I believe that when you call request.getSession(false), it will not create a new session if a valid one does not already exist. If you want to create a new one, right after invalidation of a previous session, call request.getSession() or request.getSession(true). Obviously, you will need to reset your attribute after the new session is created.Jason-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Kesav Kumar
Sent: Friday, May 11, 2001 4:17 PM
To: Orion-Interest
Subject: Session Invalidate ExceptionWhen we call invalidate() method on the session what happens?
I was doing the following and I am getting a strange error. This is just a testcondition I am giving to reproduce my error. The reality is much complex.
session.setAttribute("kesav", "I am nice");
session.invalidate();
HttpSession sess = request.getSession(false);
if(sess == null)
System.out.println("Session is null");
Object obj = sess.getAttribute("kesav");After the invalidate I was thinking that I won't get session object thats the reason I had a condition for null. What happening is I am getting a session object and when I try to access any attribute I am getting
java.lang.IllegalStateException: Session was invalidated
at com.evermind[Orion/1.4.8 (build 10374)].server.http.EvermindHttpSession.getAttribute(Unknown Source)
at /Test.jsp._jspService(/Test.jsp.java:30) (JSP page line 7)
at com.orionserver[Orion/1.4.8 (build 10374)].http.OrionHttpJspPage.service(Unknown Source)
at com.evermind[Orion/1.4.8 (build 10374)]._aj._nxd(Unknown Source)
at com.evermind[Orion/1.4.8 (build 10374)].server.http.JSPServlet.service(Unknown Source)
at com.evermind[Orion/1.4.8 (build 10374)]._iib._vfd(Unknown Source)
at com.evermind[Orion/1.4.8 (build 10374)]._iib._qjc(Unknown Source)
at com.evermind[Orion/1.4.8 (build 10374)]._kj._qbc(Unknown Source)
at com.evermind[Orion/1.4.8 (build 10374)]._kj._oa(Unknown Source)
at com.evermind[Orion/1.4.8 (build 10374)]._jw.run(Unknown Source)Any ideas why is it happening?
Kesav Kumar
Software Engineer
Voquette, Inc.
650 356 3740
mailto:[EMAIL PROTECTED]
http://www.voquette.com
Voquette...Delivering Sound Information
