Skip to content

Authentication Process 🛑🛑🛑 #52380

Closed Answered by thisalihassan
startthecode asked this question in General
Discussion options

You must be logged in to vote

I believe you are using Short-lived Access Tokens on client side and Long-lived Server Cookie on server side. Ensure that the cookie has the HttpOnly, Secure, and possibly the SameSite attributes set to enhance security.
Also I would recommend you to Implement refresh tokens to handle the renewal of access tokens securely instead of server side tokens, If an attacker gains access to this cookie, they could potentially generate new tokens and access the user's account until the cookie expires.

You can store the referesh tokens in your DB and revalidate/invalidate them accordingly before expiry

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RedYetiDev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants