#How to implement extended session management?

5 messages · Page 1 of 1 (latest)

sterile garden
#

I've implemented this with separate (Sanctum) acces tokens linked to device id. Then you can invalidate the acces token for a single device when needed. It requires some more custom methods / actions, but shouldn't be too different from the basic implementation.

sterile garden
#

Ah, yeah I was using separate front-end to connect to the backend. But even when using Inertia, you have to auth the user and 'behind the scenes' your requests will be authenticated. So when you invalidated the specific device token/session, the user on that device won't have access until re-auth.
Sorry I can't give any more clear examples, but it's usually best to figure things like this out by trial and error. Setup a fresh test install and build a few options to test. Using your browser's developer tools you can gain a lot of insights into how things work and what is going on to make all of this work.
This has given me great appreciation of all the good stuff Laravel brings us, after the initial frustration of my lack of knowledge and experience 😅

sterile garden
#

Absolutely, I just find there are so many different situations and scenarios, it can be hard to just find a ready to use example that you can implement.
For what I can tell, you're heading for the right direction. Anything specific that is not yet working on your implementation?

sterile garden
#

Sounds good! 👍

sterile garden