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

dannisi1985's avatar

how to manage user session for a mobile hybrid app and its laravel server

I think something should be returned by the server after a user signs up, and this info will be stored in the LocalStorage. So the user can use the info to post and auto sign in like 'remember me'. Will a simple user id do the job or maybe a remeber token? I'm using laravel passport and there's only one personal access token for all clients

0 likes
5 replies
dannisi1985's avatar

I just discovered Auth::once. Could this be the way to do it? So sending login info along with every request?

jekinney's avatar

Jwt token is generally the accepted practice. You can store sessions almost anywhere, but security and performance should lead you to what works best.

Check out github for more, but here is one I've used.

https://github.com/tymondesigns/jwt-auth

dannisi1985's avatar

I still have a question. How to sign up an user before he has login credentials?

Please or to participate in this conversation.