DEV Community

Discussion on: Secure Your Node.js Application With JSON Web Token

Collapse
 
themarcba profile image
Marc Backes

I don't know about the best practices about this case, but here is my opinion about it:

You can store the critical workflow data somewhere in the database, attached to the user. Then when he logs in (again), you can pull the information from there.

However, this should not happen very often. If users find themselves getting logged out much by token expiration, I'd recommend just adjusting the expiration time accordingly.

Alternatively, you can show a message, warning the user that in x minutes the session will be closed.