I think we must stress the word "automatic" in the question. We're facing
the same problem: You store many state variables in the session and then
user suddenly clicks to a unrelated link, breaking the operation sequence
and there're many variables left in the Session.

I don't think there's an automatic way to clear variables but, one solution
may be use hidden form fields instead of using session to store operation
specific variables. Another solution maybe to encapsulate operation specific
variables in an object, and store this in the session. And in any way you
explore that user begins a new operation sequence, clear this object. The
disadvantage of the first one is your variables are exposed in hidden
fields, the disadvantage of the second one is when the user chooses "Open in
Window"

Savas

> -----Original Message-----
> From: Sachin S. Khanna [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 08, 2001 9:42 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Can somebody tell me if there is a way to
> automatically invalidate a session variable?
>
>
> session.removeAttribute("Name of  the session attribute");
> It's a good practice to refer to the relevant java docs
> before posting a
> query to the list.
> Just an opinion :-).
> Have a nice day.
> With regards,
> Sachin S. Khanna
> http://www.emailanorder.com
> ----- Original Message -----
> From: Lorena Carlo <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, May 07, 2001 11:00 PM
> Subject: Can somebody tell me if there is a way to
> automatically invalidate
> a session variable?
>
>
> > Hello all,
> >
> > Can somebody tell me if there is a way to automatically invalidate a
> session
> > variable?, not the whole session, just a  variable, please
> answer me.
> >
> > Thanks in advance,
> >
> > Lorena Carlo
> >
> >
> ==============================================================
> =============
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST
> DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body:
> "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to