Help - Search - Members - Calendar
Full Version: HTML 5 Cookies and local storage
HTMLHelp Forums > Programming > Client-side Scripting
ekuemoah
Hello,
I used the localStorage command to store a cookie and retrieve a cookie. I noticed that I was able to retrieve the stored value when I stored the cookie and then pressed retrieve button. However, I was not able to do this when I stored it, closed the browser, and then tried to retrieve it. It acted like a session cookie or a temporary cookie was stored instead of a persistent cookie. How do I make the cookie into a permanent or persistent cookie?

Here are my functions:

unction storeMyName()
{var fname =document.getElementById('fname').value;
localStorage.setItem('firstname',fname);
alert("Name Stored");
}


function getMyName()
{ alert(localStorage.getItem('firstname'));

}



Thanks
Frederiek
I haven't used the HTML5 Local Storage yet, but you can read up about it here: http://diveintohtml5.org/storage.html .
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.