Leakbali
w3 Tutorial, Web Tutorial
Register   Login
Share

The sessionStorage Method 


The sessionStorage method stores the data for one session. The data is deleted when the user closes the browser window.

How to create and access a sessionStorage:
<script type="text/javascript">
sessionStorage.lastname="Smith";
document.write(sessionStorage.lastname);
The following example counts the number of times a user has visited a page, in the current session:
<script type="text/javascript">
if (sessionStorage.pagecount)
{
sessionStorage.pagecount=Number(sessionStorage.pagecount) +1;
}
else
{
sessionStorage.pagecount=1;
}
document.write("Visits "+sessionStorage.pagecount+" time(s) this session.");
</script>
More Tutorial
  1. HTML5 - Storing Data on the Client
  2. HTML5 - The localStorage Method
  3. HTML5 - The sessionStorage Method

Tutorial


References

About Us

Home
About Us
Contact Us
Sitemap

Tools

Google PageRank
Alexa Rank
Keywords Density

Accounts

Register Account
Login
Valid XHTML 1.0 TransitionalValid CSS!
Web Directory


2006 - 2012 © Leakbali.com - Free Web Tutorial, Free Web Articles, Web Sharing, Source Codes, Web References