Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81687

making localstorage expire?

$
0
0
I was having problems with a column bVisible not being applied, then i cleared localstorage and it worked. I am wondering how to make the user's browsers clear their localStorage data when i commit the changes to the production web site. Since it looks like it never expires http://stackoverflow.com/questions/2326943/when-do-items-in-html5-local-storage-expire

I was thinking maybe adding the current month in the key of the item, this way each month the settings would be refreshed? But that would leave a lot of old junk on the browsers(probably negligible to performance ?)

This is my code

 oTable = $('#visualizzazione').dataTable(
{
	"fnStateSave": function (oSettings, oData) {
 		localStorage.setItem( 'DataTables_'+window.location.pathname+$('div.login span:eq(0)').text().split(' ').join('')+"1",JSON.stringify(oData) );
	},
 	
	"fnStateLoad": function (oSettings) {
		return JSON.parse( localStorage.getItem('DataTables_'+window.location.pathname + $('div.login span:eq(0)').text().split(' ').join('')+"1") );
	},
	
	
	....

Viewing all articles
Browse latest Browse all 81687

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>