DEV Community

Discussion on: Learn and Build Web Authentication System (Universal Principles)

Collapse
 
raymag profile image
Carlos Magno

On my last project, I encrypted the user ID and stored it on cache. So when the user access a authenticated page, the server takes the cached ID, decrypt it (only the server knows the key) and store it as a session variable, so the user will always be logged in. But I don't know if it was a good idea.

Thread Thread
 
dpkahuja profile image
Deepak Ahuja 👨‍💻

Let me think about it for a while, I will get back to you with some cons of this approach which had chosen earlier. :)