Web Development Ninjas Question:

Explain me the difference between cookies, sessionStorage, and localStorage?

Tweet Share WhatsApp

Answer:

Cookies are small text files that websites place in a browser for tracking or login purposes. Meanwhile, localStorage and sessionStorage are new objects, both of which are storage specifications but vary in scope and duration. Of the two, localStorage is permanent and website-specific whereas sessionStorage only lasts as long as the duration of the longest open tab.

Download Ninjas Web Developer PDF Read All 58 Ninjas Web Developer Questions
Previous QuestionNext Question
Tell me what’s the difference between standards mode and quirks mode?Explain me how do you set an attribute using jQuery?