I am new to spring security and using it for authentication. I am facing a issue that when the browser is closed or in case of any unusual failure the session expires but I am unable catch the event so as to get the clean up code executed.
I explore about it and found HttpSessionEventPublisher
in Spring to capture HttpSessionDestroyedEvent
in sessionDestroyed()
method but that is not called when I close the browser.
Request to suggest solution for the same.