Thanks for the idea Alin. But that will invalidate all the attributes in the
session. I want to keep some. And some to keep only in the request context (what
ever you call).

request.getSession(true) -> this will create new session if you do not have a
session. I am not sure what will happen with
request.getSession(false) if you already have a session, I guess you can't
access any session variables in that servlet because it is kind of ignoring the
session. (I am not an expert on this).

anil

Alin Simionoiu wrote:

> I was thinking at something more simple then this.
> When you pass an object  between servlet1 and servlet2, you pass also the
> request object ( HttpServletRequest..)
> So, in servlet2 you can do HttpSession session =
> request.getSession(false);....right?.. ( where request is the request object
> passed by servlet1)..
> After  you serve you're client you can simple do a : session.invalidate();
> and you're session that was passed from Servlet1 is no more a valid one.
>
> Alin

Reply via email to