Thiago H. de Paula Figueiredo wrote:
> 
> 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
> 

Thanks for the reply.

However it still does not seem to be working.
The problem is that it still does not seem to be clearing.

I have admin pages that only an admin user can view. The code behind that is
working as when i login at first it determines that it is an admin user and
grants them access. The problem arises when I log in as a normal user, then
logout and try log in as an admin user. It will not grant them access as the
normal user seems to be still in session.

Any idea's?


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Clearing-SessionState-tp4458525p4458637.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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

Reply via email to