Hi, As for as was is concerned, the default session will be set to false. To get the current session use request.getSession(false); which may return the session object always eventhough the session is expired. Check the previous session variable which you kept in session . If the session variable is null then the session is expired (redirect to error page ) else the current session is alive, use it.
Ravisankar.N ----- Original Message ----- From: "Ashutosh" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 24, 2002 10:32 AM Subject: Re: Session Tracking fails -- always obtaining NEW session? Milind wrote - "If you specify getSession(true) it will create a new session object everytime." getSession(boolean b) will return the current HttpSession associated with the request. However, if there is no current session and "b" is true then a new session is returned. So, it does not create a new session object everytime. If the parameter "b" is false and the request has no valid HttpSession, the method will return null. Hence, i am not sure if setting getSession(true) will be of much help to to May. Regards, Ashutosh ----- Original Message ----- From: "Milind Kulkarni" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 24, 2002 9:58 AM Subject: Re: Session Tracking fails -- always obtaining NEW session? > session = request.getSession(false); > > should work for you. If you specify getSession(true) it will create a new > session object everytime. > Regards, > Milind > > > > > May Charles N > <[EMAIL PROTECTED] To: [EMAIL PROTECTED] > M> cc: > Sent by: A Subject: Session Tracking fails -- always obtaining NEW session? > mailing list for > Enterprise > JavaBeans > development > <EJB-INTEREST@JAV > A.SUN.COM> > > > 09/24/2002 01:58 > AM > Please respond to > May Charles N > > > > > > > I would like to be able to save a Stateful Session Bean Handle in an > HttpSession. > Every time my HttpServlet code (executing in the Websphere 3.5.3 Test > Environment) hits the line: > session = request.getSession(true); > it obtains a NEW session rather than an existing one, even if previous > requests have hit the same servlet in the same test. > > > I've tried this with raw code as a test client and it fails; then I tried > making a JApplet client and running it in AppletViewer and get the same > result. Is it impossible to test session tracking in the test environment? > What am I missing? > > > Charles May > Software Engineer > Technology Delivery Department (TDD) > Mellon Financial Corporation > Pittsburgh, PA > > > > > > > ***************************************************************** > DISCLAIMER: The information contained in this e-mail may be confidential > and is intended solely for the use of the named addressee. Access, copying > or re-use of the e-mail or any information contained therein by any other > person is not authorized. If you are not the intended recipient please > notify us immediately by returning the e-mail to the originator. > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff EJB-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". > =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
