Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lloyd_mensah's avatar

URGENT. i want to display a sweet alert when a logout the user on other devices

My laravel application invalidates sessions on other devices whenever the user logs in on another device. I want to display a sweet alert when the session on the "older" device is invalidated.

PS; I used logoutOtherDevices

0 likes
1 reply
christian-qode's avatar

If you want a 'sweet alert' like a pop-up, you'll need to implement something like websockets to receive a signal when the user is logged out.

The less 'sweet' but more easy approach is to create a page the user is redirected to when logged out because of another session. This redirect can be implemented in the code you're logging the user out.

Please or to participate in this conversation.