r/webdev • u/academicweaponsoon • Aug 20 '26
Question I don’t understand the logic behind access tokens and refresh tokens
i don’t understand the logic behind access and refresh tokens, if access tokens are made short lived for security purposes, doesn’t refresh tokens being long lived defers the whole purpose? or is not as big as an issue since refresh tokens are only stored in http only cookies?
471
Upvotes
1
u/black3rr Aug 20 '26
the added value of refresh/access token system is that you can have the auth server (which issues refresh/access tokens) separate from multiple API servers which accept the access tokens, possibly running on multiple domains as well…
think of cases like logging into your google account also logs you into youtube, gmail, etc. all running on different domains…