4 ms·
A cookie is a tiny plaintext file limited at 4kb. Your browser keeps an inventory of them, lets you read or delete them, and automatically clears them out regul
by legitster 4y ago
A cookie is a tiny plaintext file limited at 4kb. Your browser keeps an inventory of them, lets you read or delete them, and automatically clears them out regularly.
Local storage can contain just about any type of user data without letting users know, and theoretically forever.
If you have to store local data, and you cared about "innocence" (author's word), it seems to me a cookie set to the local domain leaves less room for shenanigans. Hence why Google probably disables it when you disable cookies as well.
- potatoz2 4y agoLooks like local storage has a max size of 5MB and cookies 180 * 4KB = 0.7MB, so a similar order of magnitude. AFAIK, cookies can be set to expire in hundreds of years by sites and local storage can be cleared the same way as cookies.
- legitster 4y agoI mean, you can make a cookie that is anything you want, but browsers accept what they accept. For Chrome that's a <4kb cookie with a max-expiration of 400 days. I think localStorage being slightly better or worse than a local cookie is up for discussion. I just think you're weird if you think local cookies are bad but localStorage is good.