• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invalidate Session Sequence

 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's written in Hanhumant Deshmukh's book that
"The servlet container calls the sessionDestroyed() method after the session is invalidated. but when i invalidated a session, it didn't called sessionDestroyed() though it called() valueUnbound()
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sessionDestroyed() of the HttpSessionListener interface is called when the session is about to be invalidated, not after.
Did you register the listener correctly ?
 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you are right. The output is :

Inside Session Created()
Adding useridwrapper attribute to session
Inside valuebound()
Inside attributeAdded()
Added useridwrapper attribute to session
Calling Invalidate()
Inside Session Destroyed()
Inside valueUnbound()
Inside attributeRemoved()
Invalidate() Over

But why Destroyed() first & then valueUnbound() & attributeRemoved(). Also does anywhere in HFSJ book this sequence is mentioned ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic