Dash login user session ending on page exit

Hello everyone.
Just wanted to know if there was any way to end the user session on the exit from the page. i know there exists a user session ending way in flask so i was thinking if there was a way to use it somehow here.

Thanks in advance!!