Click here to Skip to main content
11,929,971 members (54,246 online)
Rate this:
Please Sign up or sign in to vote.
I'm facing an interesting issue, the 'localStorage' is not working in different master pages of same web application.

In my application I'm using 'localStorage' to remember the input given by user in a particular text-box (its inside the master page of logged-in user) and I'm trying to clear this "localStorage" upon next time the user log-in(this page using different master page- 'public user master page').

I'm not able to take/clear the localStorage from public user master page, which was set inside logged-in user's master page. Has the "localStorage" have any dependency on master pages? I'm using below code to set and clear localStorage.

//sets the value
if (typeof  (Storage) != "undefined") {
    localStorage.UserInput = 'xxxx';

Any help will greatly appreciated.

Posted 9-Jul-12 5:31am
Edited 18-Sep-12 3:24am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I tried the following in the IE debugger console;

>>localStorage["Dave"] = "Dave";
>>localStorage.Aproperty = "Dave";

works as expected..........

I know that this isn't an Answer, but it wouldn't look right as a comment.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.1 | Last Updated 18 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100