diff --git a/packages/quiz/questions/describe-the-difference-between-a-cookie-sessionstorage-and-localstorage/en-US.mdx b/packages/quiz/questions/describe-the-difference-between-a-cookie-sessionstorage-and-localstorage/en-US.mdx index a86bd6b28..dbdcbb522 100644 --- a/packages/quiz/questions/describe-the-difference-between-a-cookie-sessionstorage-and-localstorage/en-US.mdx +++ b/packages/quiz/questions/describe-the-difference-between-a-cookie-sessionstorage-and-localstorage/en-US.mdx @@ -2,6 +2,12 @@ title: Describe the difference between a cookie, `sessionStorage` and `localStorage`. --- +Local storage is useful for storing data that the user will need to access later, such as offline data, because it stores the data in the browser and the system. This data will persist even if the user closes and reopens the browser and is accessible by other sites. + +Session storage is a great way to improve the performance of your web applications. It stores data locally on the browser but is specific to (and only accessible by) the respective site/browser tab and is only available while the user is on the site/tab. This is a more secure storage method due to the restrictive access and promotes better site performance due to reduced data transfer between server and client. + +Cookies are a good choice for storing data that should not be persisted for a long time, such as session IDs. Cookies allow you to set an expiry time at which point it would be deleted. Cookies can only be smaller sized data compared to the other two storage methods. + ## Similarities Cookies, `localStorage`, and `sessionStorage`, are all: