Topic on Talk:ResourceLoader/Core modules

jquery.jStorage saved data lost on logout

1
Kaniivel (talkcontribs)

When user logs out of Wikipedia and in again, all data that was saved in browser locally through jquery.jStorage module is gone. Try the example code below. It saves Date() values at the page loading time and displays all saved values. Everything is perfect until you log out.

mw.loader.load( 'jquery.jStorage' );
$(document).ready(function(){
	var value = new Date();
	var key = value.getTime();	
	$.jStorage.set( key, value.toString() );
	var jSindex = $.jStorage.index();	
	var i;
	var txt = "You have loaded the script at following times:\n\n";	
	for	(i = 0; i < jSindex.length; i++) {
		txt += (i + 1) + ". " + $.jStorage.get(jSindex[i]) + ",\n";
	}
	alert (txt);
});
Reply to "jquery.jStorage saved data lost on logout"