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

susanne99's avatar

Laravel 11 Sanctum -> How can I determine when I log out in another browser?

I use Laravel 11 Sanctum with a VUE SPA app. If you are logged into my program in two browsers and one logs out, then the other no longer works - of course! How can I be routed to the login page in a controlled manner when a browser or tab logs out?

0 likes
2 replies
jlrdw's avatar

You do use tokens and cookies (or local storage), not session, correct?

1 like
susanne99's avatar

@jlrdw yes, you are right. other sites, amazon, google have the same "problem". but they redirect "clean" to the login page. in my case, i send a request to my middleware (made with laravel) then i go into the controller and load for instance all registered users. and then does this error occur "unauthorized"

Please or to participate in this conversation.