@krishnachaytanya: JWT (JSON Web Token) explained : how you stay logged in without the server remembering you. With sessions, your cookie is just a random session id. It proves nothing on its own, so the server looks it up in a session database on every single request. That is one session lookup per request. A JWT works differently. It is issued at login and carries your details inside it (who you are, your role, when it expires) plus a signature the server computes with a secret only it holds. So every request is verified with math instead of a database lookup. Any server holding the key can check it on its own, which is why JWTs are the default for APIs and microservices. Change one character of the payload, role: user to role: admin, and the signature stops matching. Rejected instantly. The thing people get wrong: a JWT is signed, not encrypted. Anyone can decode and read the payload. Never put secrets in one. The tradeoff: you cannot easily revoke a JWT before it expires. That is what short expiry and refresh tokens are for. Auth0, Firebase, GitHub and "Login with Google" all run on this. Save this for your next system design interview, and send it to the dev who still cannot explain the difference between sessions and tokens. #trending #vibecoding #systemdesign #ai #softwarearchitecture
KrishnaChaitanya|SystemDesign
Region: US
Monday 31 August 2026 13:00:09 GMT
Music
Download
Comments
Dara Rath :
I did both. for refresh token using session whereas access token use jwt with short live and session long live. session in cookie with secure whereas jwt store on memory only no browser storage, prevent from xss attack
2026-08-31 13:34:24
0
To see more videos from user @krishnachaytanya, please go to the Tikwm
homepage.