---
title: "What is the sessionStorage Object in html5 ? How to create and access ?"  
description: "What is the sessionStorage Object in html5 ? How to create and access ?"  
author: "AVADHESH PATEL"  
published: 2012-10-20  
updated: 2020-09-16  
canonical: https://www.mindstick.com/interview/1547/what-is-the-sessionstorage-object-in-html5-how-to-create-and-access  
category: "html5"  
tags: ["html5"]  
reading_time: 1 minute  

---

# What is the sessionStorage Object in html5 ? How to create and access ?

The sessionStorage object stores the data for one session. The data is deleted when the user closes the browser window. like below we can create and access a sessionStorage here we created "name" as session\
<script type="text/javascript">\
sessionStorage.name="PCDS";\
document.write(sessionStorage.name);\
</script>

## Answers

### Answer by AVADHESH PATEL

The sessionStorage object stores the data for one session. The data is deleted when the user closes the browser window. like below we can create and access a sessionStorage here we created "name" as session\
<script type="text/javascript">\
sessionStorage.name="PCDS";\
document.write(sessionStorage.name);\
</script>


---

Original Source: https://www.mindstick.com/interview/1547/what-is-the-sessionstorage-object-in-html5-how-to-create-and-access

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
