The location of local storage on the file system is most likely an implementation detail that is not guaranteed to always be the same from version to version (it could even change with a service pack or update to IE).
To clear local storage using the approved methods, see Clearing the Storage Areas on the Introduction to DOM Storage MSDN page:
Clearing the Storage Areas
Session state is released as soon as
the last window to reference that data
is closed. However, users can clear
storage areas at any time by selecting
Delete Browsing History from the Tools
menu in Internet Explorer, selecting
the Cookies check box, and clicking
OK. This clears session and local
storage areas for all domains that are
not in the Favorites folder and resets
the storage quotas in the registry.
Clear the Preserve Favorite Site Data
check box to delete all storage areas,
regardless of source.
To delete key/value pairs from a
storage list, iterate over the
collection with removeItem or use
clear to remove all items at once.
Keep in mind that changes to a local
storage area are saved to disk
asynchronously.
An alternative to using the approved methods is to use a tool like Process Monitor to watch disk and Registry accesses while you write something to window.localStorage
. Unfortunately, if you see it writing to a file like %userprofile%Cookiesindex.dat
it would probably be unwise to delete that file (since it contains information about all the other cookies IE knows about).
EDIT: Using my own suggestion I found that local storage seems to be at %userprofile%Local SettingsApplication DataMicrosoftInternet ExplorerDOMStore
(in Windows XP, Vista and Windows 7 will be slightly different). They are just XML files but I'm not sure how safe they are to delete because of the index.dat
(which may retain information about the existence of the XML files or their contents).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…