You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Heligon Sandra <Sa...@nextream.fr> on 2002/07/03 18:50:48 UTC
Struts LogoffAction example error ?
I posted a message on a forum about HttpSession and Logoff.
I asked why doesn't it not allow to clear simultaneously all session
attributes?, in the LoggoffAction of the struts example
we find the following lines:
session.removeAttribute(Constants.SUBSCRIPTION_KEY);
session.removeAttribute(Constants.USER_KEY);
session.invalidate();
My question was:
What cautions do I have to take in a logoff operation ?
Are the two steps removeAttribute and invalidate enough?
The answer is: invalidate is all you need as all of the session's
data members (including attributes) are then available for garbage
collection.
I don't know who wrote the struts example, the author has perhabs a
reason to use
removeAttribute ?
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>