<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>html web storage - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/html-web-storage/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/html-web-storage/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Thu, 29 Feb 2024 13:34:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>html web storage - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/html-web-storage/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What are the different types of storage in HTML5 ?</title>
		<link>https://www.wikitechy.com/interview-questions/html/what-are-the-different-types-of-storage-in-html5/</link>
					<comments>https://www.wikitechy.com/interview-questions/html/what-are-the-different-types-of-storage-in-html5/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Wed, 26 Oct 2022 11:34:59 +0000</pubDate>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[html web storage]]></category>
		<category><![CDATA[html web storage api]]></category>
		<category><![CDATA[html5 web storage]]></category>
		<category><![CDATA[html5 web storage vs cookies]]></category>
		<category><![CDATA[session storage in html5]]></category>
		<category><![CDATA[web storage]]></category>
		<category><![CDATA[web storage api]]></category>
		<category><![CDATA[web storage html]]></category>
		<category><![CDATA[what are the different types of storage in html5]]></category>
		<category><![CDATA[what are two types of web storage in html5]]></category>
		<category><![CDATA[what is web storage]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=5049</guid>

					<description><![CDATA[In HTML5, web storage is one of the great features. In Web storage, web applications can locally store data within the browser on the client side. It is sometimes known as DOM storage and stores data in the form of key/value pair on the browser. Web storage is better and faster than cookies storage, and [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">In HTML5, web storage is one of the great features. In Web storage, <em>web applications can locally store data within the browser on the client side.</em></li>
<li style="text-align: justify;"><em>It is sometimes known as DOM storage and stores data in the form of </em>key/value pair on the browser.</li>
<li style="text-align: justify;">Web storage is better and faster than cookies storage, and storing data is similar to cookies.</li>
<li style="text-align: justify;">Similarly, Web Storage can use storage space of up to 5MB per domain.</li>
<li style="text-align: justify;">It is faster than cookies storage because It will not send data to the server side.</li>
<li style="text-align: justify;">At web storage cookies data expires after some time or session but data stored by local Storage never expires.</li>
<li style="text-align: justify;">There are two types of web storage, they are;
<ul>
<li>Local Storage</li>
<li>Session Storage</li>
<li>If you are in the market for superclone <a href="https://replicarolexexpert.io/" target="_blank" rel="noopener">Replica Rolex</a> , Super Clone Rolex is the place to go! The largest collection of fake Rolex watches online!</li>
</ul>
</li>
</ul>
<h2 id="local-storage">Local Storage</h2>
<ul>
<li>In this the local Storage object stores data locally within the browser.</li>
<li>The data stored by local Storage object does not have any expiration date.</li>
<li>The stored data will not be deleted if the browser is reopened or closed.</li>
<li>The key/values are always stored as String, and can be accessed with localStorage.setItem() and localStorage.getItem() methods.</li>
</ul>
<h2 id="sample-code">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-markup code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-markup code-embed-code">&lt;!DOCTYPE html&gt;<br/>&lt;html&gt;<br/>&lt;head&gt;<br/>  &lt;title&gt;Web Storage API&lt;/title&gt;<br/>  &lt;style&gt;<br/>    body{<br/>      color: blue;<br/>      text-align: center;<br/>      font-size: 30px;<br/>      margin-top: 30px;<br/>      font-style: italic;<br/>    }<br/>  &lt;/style&gt;<br/>&lt;/head&gt;<br/>&lt;body&gt;<br/>&lt;script&gt;<br/> if(typeof(Storage)!==&quot;undefined&quot;) {<br/>  localStorage.setItem(&quot;name&quot;,&quot;Venkat&quot;);<br/>  localStorage.setItem(&quot;Country&quot;, &quot;India&quot;);<br/>   document.write(&quot;Hi this is&quot;+&quot; &quot;+localStorage.name+&quot; &quot;+&quot;from&quot; +&quot; &quot;+ localStorage.Country);<br/>}<br/> else{<br/>  alert(&quot;Sorry! your browser is not supporting the browser&quot;)<br/> }<br/>&lt;/script&gt;<br/>&lt;/body&gt;<br/>&lt;/html&gt;</code></pre> </div>
<h2 id="output">Output</h2>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-5050" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/local-storage.png" alt="" width="1285" height="525" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/local-storage.png 1285w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/local-storage-300x123.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/local-storage-1024x418.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/local-storage-768x314.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/local-storage-390x159.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/local-storage-820x335.png 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/local-storage-1180x482.png 1180w" sizes="(max-width: 1285px) 100vw, 1285px" /></p>
<h2 id="session-storage">Session Storage</h2>
<ul>
<li>The session storage is same as local storage, but session storage stores data only for one session.</li>
<li>If you close the browser, then data will be deleted or lost.</li>
</ul>
<h2 id="sample-code-2">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-markup code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-markup code-embed-code">&lt;!DOCTYPE html&gt;<br/>&lt;html&gt;<br/>&lt;head&gt;<br/>&lt;script&gt;<br/>function clickCounter() {<br/>  if (typeof(Storage) !== &quot;undefined&quot;) {<br/>    if (sessionStorage.clickcount) {<br/>      sessionStorage.clickcount = Number(sessionStorage.clickcount)+1;<br/>    } else {<br/>      sessionStorage.clickcount = 1;<br/>    }<br/>    document.getElementById(&quot;result&quot;).innerHTML = &quot;You have clicked the button &quot; + sessionStorage.clickcount + &quot; time(s) in this session.&quot;;<br/>  } else {<br/>    document.getElementById(&quot;result&quot;).innerHTML = &quot;Sorry, your browser does not support web storage...&quot;;<br/>  }<br/>}<br/>&lt;/script&gt;<br/>&lt;/head&gt;<br/>&lt;body&gt;<br/><br/>&lt;p&gt;&lt;button onclick=&quot;clickCounter()&quot; type=&quot;button&quot;&gt;Click me!&lt;/button&gt;&lt;/p&gt;<br/>&lt;div id=&quot;result&quot;&gt;&lt;/div&gt;<br/>&lt;p&gt;Click the button to see the counter increase.&lt;/p&gt;<br/>&lt;p&gt;Close the browser tab (or window), and try again, and the counter is reset.&lt;/p&gt;<br/><br/>&lt;/body&gt;<br/>&lt;/html&gt;</code></pre> </div>
<h2 id="output-2">Output</h2>
<p><img decoding="async" class="alignnone size-full wp-image-5051" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/session-storage.png" alt="" width="1287" height="608" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/session-storage.png 1287w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/session-storage-300x142.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/session-storage-1024x484.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/session-storage-768x363.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/session-storage-390x184.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/session-storage-820x387.png 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/session-storage-1180x557.png 1180w" sizes="(max-width: 1287px) 100vw, 1287px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/html/what-are-the-different-types-of-storage-in-html5/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
