JS Coding Questions Logo
JS Coding Questions
#42💼 Interview

What are the differences between cookie, local storage and session storage

Advertisement

728x90

Below are some of the differences between cookie, local storage and session storage,

| Feature | Cookie | Local storage | Session storage |

| --------------------------------- | ------------------------------------------------------------------------------------------------------------------- | --------------------- | ------------------- |

| Accessed on client or server side | Both server-side & client-side. The set-cookie HTTP response header is used by server inorder to send it to user. | client-side only | client-side only |

| Expiry | Manually configured using Expires option | Forever until deleted | until tab is closed |

| SSL support | Supported | Not supported | Not supported |

| Maximum data size | 4KB | 5 MB | 5MB |

| Accessible from | Any window | Any window | Same tab |

| Sent with requests | Yes | No | No |

Advertisement

Responsive Ad
🎯 Practice NowRelated Challenge

JavaScript Coding Exercise 44

Test your knowledge with this interactive coding challenge.

Start Coding

Advertisement

728x90
42of476
What are the differences between cookie, local storage and session storage | JSCodingQuestions.com