How to close/kill the session if the browser/tab is closed

Is there any way to close or kill the session, if we close the browser or tab.

Expectation is to the close or kill the session on the closure of browser or tab and make the user re-login.

Answered here.