Home > DeveloperSection > Interviews > What are the different types of storage in HTML 5?

Posted on    October-11-2011 2:56 AM

 HTML5 HTML5 
Ratings:
 1 Answer(s)
  4030  View(s)
Rate this:

Arun Singh

Total Post:310

Points:1550
Posted on    October-11-2011 12:00 AM

HTML5 offers two new objects for storing data on the client:

LocalStorage - stores data with no time limit

<script type="text/javascript">
    localStorage.lastname="Smith";
    document.write(localStorage.lastname);
</script>

SessionStorage - stores data for one session.The data is deleted when the user closes the browser window.

<script type="text/javascript">
        sessionStorage.lastname="Smith";
       document.write(sessionStorage.lastname);
</script>


Don't want to miss updates? Please click the below button!

Follow MindStick