Re: problem invalidating servlet
I guess request.getSession() (aka request.getSession(false) ) gives you existing session object. I don't know how exactly orion implements it, but apparently there is still a valid reference to session object after session.invalidate() is called. To supress it just use request.getSession(true), it will sure create new session for you. if (event instanceof LogoutEvent) { request.getSession().invalidate(); HttpSession validSession = request.getSession(true); validSession.setAttribute(WebKeys.ModelManagerKey, mm); } ~boris Matt Bauer wrote: > Indeed I was > > Matt > > Conrad Chan wrote: > > > I think he was trying to invalidate the existing session before setting the >attribute. > > > > Conrad > > > > -Original Message- > > From: Boris Erukhimov [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, January 24, 2001 4:05 AM > > To: Orion-Interest > > Subject: Re: problem invalidating servlet > > > > Try this ... > > > > if (event instanceof LogoutEvent) { > > HttpSession validSession = request.getSession(true); > > validSession.setAttribute(WebKeys.ModelManagerKey, mm); > > } > > > > ~boris > > > > Matt Bauer wrote: > > > > > I have this small bit of code that handles a log out. What I want to do > > > is invalidate the session and put a new on in its place. The problem is > > > when I try to set the attribute, I get an exception telling my the > > > session is invalidated. Am I missing something? > > > > > > if (event instanceof LogoutEvent) { > > > request.getSession().invalidate(); > > > HttpSession validSession = request.getSession(); > > > validSession.setAttribute(WebKeys.ModelManagerKey, mm); > > > } > > > > > > Thanks > > > > > > M
Re: problem invalidating servlet
Indeed I was Matt Conrad Chan wrote: > I think he was trying to invalidate the existing session before setting the >attribute. > > Conrad > > -Original Message- > From: Boris Erukhimov [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 24, 2001 4:05 AM > To: Orion-Interest > Subject: Re: problem invalidating servlet > > Try this ... > > if (event instanceof LogoutEvent) { > HttpSession validSession = request.getSession(true); > validSession.setAttribute(WebKeys.ModelManagerKey, mm); > } > > ~boris > > Matt Bauer wrote: > > > I have this small bit of code that handles a log out. What I want to do > > is invalidate the session and put a new on in its place. The problem is > > when I try to set the attribute, I get an exception telling my the > > session is invalidated. Am I missing something? > > > > if (event instanceof LogoutEvent) { > > request.getSession().invalidate(); > > HttpSession validSession = request.getSession(); > > validSession.setAttribute(WebKeys.ModelManagerKey, mm); > > } > > > > Thanks > > > > M
RE: problem invalidating servlet
I think he was trying to invalidate the existing session before setting the attribute. Conrad -Original Message- From: Boris Erukhimov [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 24, 2001 4:05 AM To: Orion-Interest Subject: Re: problem invalidating servlet Try this ... if (event instanceof LogoutEvent) { HttpSession validSession = request.getSession(true); validSession.setAttribute(WebKeys.ModelManagerKey, mm); } ~boris Matt Bauer wrote: > I have this small bit of code that handles a log out. What I want to do > is invalidate the session and put a new on in its place. The problem is > when I try to set the attribute, I get an exception telling my the > session is invalidated. Am I missing something? > > if (event instanceof LogoutEvent) { > request.getSession().invalidate(); > HttpSession validSession = request.getSession(); > validSession.setAttribute(WebKeys.ModelManagerKey, mm); > } > > Thanks > > M
Re: problem invalidating servlet
Try this ... if (event instanceof LogoutEvent) { HttpSession validSession = request.getSession(true); validSession.setAttribute(WebKeys.ModelManagerKey, mm); } ~boris Matt Bauer wrote: > I have this small bit of code that handles a log out. What I want to do > is invalidate the session and put a new on in its place. The problem is > when I try to set the attribute, I get an exception telling my the > session is invalidated. Am I missing something? > > if (event instanceof LogoutEvent) { > request.getSession().invalidate(); > HttpSession validSession = request.getSession(); > validSession.setAttribute(WebKeys.ModelManagerKey, mm); > } > > Thanks > > M