Support the ongoing development of Laravel.io →
posted 1 month ago
Session
0

Hi @msr-nayeem 👋

You could add an event listener for the beforeunload event in javascript that sends an ajax request to the backend to destroy the current session but there's no 100% chance that this will be executed every time successfully.

Have a look at the docs here: https://developer.mozilla.org/en-US/docs/Web/API/Window/before...

I wish you a great day!

0

Sign in to participate in this thread!

LoadForge

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.