I'm trying to end a user's session when they close the browser,
because they never logout properly.
I need to change a value in the db after they close the browser only.
This does work on closing the browser but unfornately also when I redirect to any other page.
Is there any way to do this for browser close only?