DEV Community

Discussion on: From Cookie strings into usable JavaScript

Collapse
 
ahmad_butt_faa7e5cc876ea7 profile image
Ahmad

thanks for sharing the code! interesting use case with multiple cookies..any specific reason why if you dont mind me asking?

Collapse
 
asg5704 profile image
Alexander Garcia

Sure. On our project we have multiple cookies being set for OAuth with most of them being httpOnly cookies (meaning they aren't accessible to JavaScript). We decided to store the token's expiration in a cookie available in JavaScript so that we could reduce the number of network requests and only call a silent refresh request when needed.