Cookies, Local or Session Storage | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Cookies, Local or Session Storage

What is the difference between Cookies and Local or Session storage?

15th Dec 2017, 11:02 PM
Tahir Muhammad
Tahir Muhammad - avatar
1 Answer
+ 2
Cookies are small files stored on your computer which websites request through the browser, to offer a personalised experience: if they know you always like a cheap deal, online shops will always recommend cheap deals. Cookies are stored on the user's computer. Session storage is data stored by the browser, which on termination of the browser window, will be deleted. The data is stored in a temporary file. Local storage is data stored forever, by the browser in its file directory. Local storage may not be used across computers, the files must be transfered over. Session storage is the recommended solution to temporary storage, cookies have a limitation on size, while session storage files are significantly larger. Local storage can be used, if you want to store a web-game's player data, inventory, world pos, etc.
16th Dec 2017, 12:02 AM
ghostwalker13
ghostwalker13 - avatar