On Mon, 06 Jun 2011 09:26:26 -0300, robnangle <robnan...@gmail.com> wrote:

Hi All,

Hi!

I create have a @SessionState on my user but when I try logout it is not
fully clearing the session.

@SessionState
private User user;

Setting a @SessionState field to null will remove it from the session, but just it. And don't forget that when you use @SessionState and the object isn't in the session it's instantiated automatically and put in the session. @SessionState(create = false) prevent this.

To invalidate (clear) the session, use this:

@Inject
private Request request;

Session session = request.getSession(false);
if (session != null) {
        session.invalidate();
}

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to