Earlier quoted context omitted.
Not true. Encode a token and validate it against a constant, which you change in case of a compromise.
How do you encode it in such a way that you can invalidate individual tokens? How do you distribute that information among your services?
Stop using JWT for sessions (2016)
31–40 of 255 posts
Re: Stop using JWT for sessions (2016)
#32Can someone explain the Cookie vs LocalStorage thing? You can access cookies from Javascript, so how is localstorage worse? Assuming an attacker can execute arbitrary js in the browser (the model provided by the article). edit: Thanks for the answers - httponly, makes sense.
Re: Stop using JWT for sessions (2016)
#33Can someone explain the Cookie vs LocalStorage thing? You can access cookies from Javascript, so how is localstorage worse? Assuming an attacker can execute arbitrary js in the browser (the model provided by the article). edit: Thanks for the answers - httponly, makes sense.
Re: Stop using JWT for sessions (2016)
#34Can someone explain the Cookie vs LocalStorage thing? You can access cookies from Javascript, so how is localstorage worse? Assuming an attacker can execute arbitrary js in the browser (the model provided by the article). edit: Thanks for the answers - httponly, makes sense.
You can access it via JS only if you don't set the httpOnly flag on the cookie.
Re: Stop using JWT for sessions (2016)
#35Re: Stop using JWT for sessions (2016)
#36Re: Stop using JWT for sessions (2016)
#37We have a requirement that users be logged out after 30 minutes of inactivity, so JWTs are perfect for our use case.
Re: Stop using JWT for sessions (2016)
#38Earlier quoted context omitted.
How do you encode it in such a way that you can invalidate individual tokens? How do you distribute that information among your services?
In the past, I've compared the "iat" (issued at) value with a column in the users table called "invalidate_tokens_before". If I need to invalidate tokens for a user (for my use case, it would always be all tokens for a user at once), I just touch that timestamp column. True, it still required a db lookup (one that happens anyway), but I found that easier to manage than storing and managing session tokens.
Re: Stop using JWT for sessions (2016)
#39Re: Stop using JWT for sessions (2016)
#40Can someone explain the Cookie vs LocalStorage thing? You can access cookies from Javascript, so how is localstorage worse? Assuming an attacker can execute arbitrary js in the browser (the model provided by the article). edit: Thanks for the answers - httponly, makes sense.