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

thebigk's avatar
Level 13

Keep user always logged-in on a PWA

I'm currently working on a PWA and noticed that the overall experience would be awesome for the users, if they do not have to sign-in every time they open the app.

I've noticed that on native mobile apps, the user stays signed in unless they decide logging out of the app.

I could think about the following approaches -

  1. Make the session time super long; say 30 days or 180 days. I'm not aware of the downsides of this approach.

  2. Create a cookie that says that auto-login link and use it to authenticate the user automatically when they open the app.

  3. Do something with a 'signed url' with a very long expiry time. Have not explored this option; but maybe?

But there could be a way better approach than this; and I'm curious to know about it. Can someone help?

0 likes
1 reply

Please or to participate in this conversation.