2

I have JSF page which needs clear the session when its browser closed.Could anyone please help me on this to clear the session on browser close in jsf page.

  • I am just looking at forum to implement this.But all I found are not possible to clear the session when browser close in jsf page.I have acheived the same functionality through command button by addin below code FacesContext.getCurrentInstance().getExternalContext().invalidateSession();.But I want through browser close. – user3328103 Mar 07 '14 at 10:31

1 Answers1

0

keep stuff in Session scoped object (Seam: @Scope(ScopeType.SESSION) under seam component, ejb: @SessionScoped, grails: session, etc), so that have it invalidated automatically when http session ends. be careful with session scoped objects: synchronization, memory leak, etc..

nigi
  • 136
  • 5