Click below for Step by Step and Interview Q & A (dotnetinter) wrote,
Click below for Step by Step and Interview Q & A

HTML 5 interview questions with answers for LocalStorage and SessionStorage

What is localStorage in Html 5?

It is feature in HTML5 which let us store user data locally within user’s browser.

How it different from Cookies?

  • They are more secure because web pages can access only access data stored by itself.

  • They are more faster

  • Easy to retrieve and write compare to cookies

  • Not included with every server request

  • Supports large amount of data and even won’t affect performance.

How it is different from sessionstorage?

localStorage stores data with no expiration date whereas sessionStorage stores data for one session

Can we see a small example?

localStorage.MyName="Sukesh Marla";
document.getElementById("Name").innerHTML="Name: "
+ localStorage.MyName;

Tags: csharp interview questions, html 5 interview questions with answers, information technology questions, localstorage, programming interview questions, sessionstorage

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded