DEV Community

Discussion on: LocalStorage vs Cookies: All You Need To Know About Storing JWT Tokens Securely in The Front-End

Collapse
 
ponyjackal profile image
ponyjackal

Hi, I am so excited about this article,
But what if the refresh token takes more than 4KB?
Is there any way to increase the space of Cookie?
Cookie is reling on the type of Browser?

Collapse
 
putrikarunia profile image
Putri Karunia

Hi Pony, refresh tokens are usually opaque random strings stored in your database, so they shouldn't take more than 4KB.

I don't think that there's a way to increase the space, but you might be able to split a large cookie into 2. However some browser limits cookie size per domain, so that wouldn't work.

Here's a nice list about cookie limits per browser browsercookielimits.squawky.net/.

Collapse
 
ponyjackal profile image
ponyjackal

Thank you for your kind support
Love to wait for your next post

Collapse
 
mellen profile image
Matt Ellen

Hi Putri,

Just to let you know that the link in your reply is now dead.