• Post Reply Bookmark Topic Watch Topic
  • New Topic

Deleting session

 
tun zaw
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to delete entired session.

I have two managed bean with session scope user bean and admin bean.I want to invalidate only user bean.What code snipped i should use.
If i use session.invalidate(),both bean are deleted.

Thanks you very much for saloon.javaranch.com's helps.

Please help me.
 
Tim Holloway
Bartender
Posts: 18412
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, when you do session.invalidate(), you DO delete the entire session and all the session variables.

You can delete an individual session object by obtaining the HttpSession and calling its removeAttribute method. However, I'm not sure what the consequences of doing this on a managed session-scope bean might be. Non-managed session-scope beans would be OK.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!