Index: js/autosave.js
===================================================================
--- js/autosave.js	(revision 23348)
+++ js/autosave.js	(working copy)
@@ -5,9 +5,13 @@
 	autosaveLast = ( $('#post #title').val() || '' ) + ( $('#post #content').val() || '' );
 	autosavePeriodical = $.schedule({time: autosaveL10n.autosaveInterval * 1000, func: function() { autosave(); }, repeat: true, protect: true});
 
+    autosavePeriodical_client = $.schedule({time: 10000, func: function() { autosave_set_local_storage(); }, repeat: true, protect: true});
+
 	//Disable autosave after the form has been submitted
 	$("#post").submit(function() {
 		$.cancel(autosavePeriodical);
+        $.cancel(autosavePeriodical_client);
+        autosave_delete_local_storage();
 		autosaveLockRelease = false;
 	});
 
@@ -162,6 +166,8 @@
 		// if no errors: add slug UI
 		if ( !res.errors ) {
 			postID = parseInt( res.responses[0].id, 10 );
+
+            autosave_delete_local_storage();
 			if ( !isNaN(postID) && postID > 0 ) {
 				autosave_update_slug(postID);
 			}
@@ -341,6 +347,9 @@
 	}
 
 	autosaveOldMessage = jQuery('#autosave').html();
+
+    autosave_set_local_storage( post_data );
+
 	jQuery.ajax({
 		data: post_data,
 		beforeSend: doAutoSave ? autosave_loading : null,
@@ -349,3 +358,84 @@
 		success: successCallback
 	});
 }
+
+function autosave_prepare_data_to_save( ) {
+
+    var post_data = {
+        action: "autosave",
+        post_ID:  jQuery("#post_ID").val() || 0,
+        post_type: jQuery('#post_type').val() || ""
+    };
+
+    if ( fullscreen && fullscreen.settings.visible ) {
+        post_data["post_title"] = jQuery('#wp-fullscreen-title').val() || '';
+        post_data["content"] = jQuery("#wp_mce_fullscreen").val() || '';
+    } else {
+        post_data["post_title"] = jQuery("#title").val() || '';
+        post_data["content"] = jQuery("#content").val() || '';
+    }
+
+    if ( jQuery('#post_name').val() )
+        post_data["post_name"] = jQuery('#post_name').val();
+
+    var cats = ([]);
+
+    jQuery("[name='post_category[]']:checked").each( function(i) {
+        cats.push(this.value);
+    } );
+    post_data["catslist"] = cats.join(",");
+
+    if ( jQuery("#comment_status").prop("checked") )
+        post_data["comment_status"] = 'open';
+    if ( jQuery("#ping_status").prop("checked") )
+        post_data["ping_status"] = 'open';
+    if ( jQuery("#excerpt").size() )
+        post_data["excerpt"] = jQuery("#excerpt").val();
+    if ( jQuery("#post_author").size() )
+        post_data["post_author"] = jQuery("#post_author").val();
+    if ( jQuery("#parent_id").val() )
+        post_data["parent_id"] = jQuery("#parent_id").val();
+    post_data["user_ID"] = jQuery("#user-id").val();
+    if ( jQuery('#auto_draft').val() == '1' )
+        post_data["auto_draft"] = '1';
+
+    return post_data;
+
+}
+
+function autosave_set_local_storage( ) {
+
+    if ( window.localStorage ) {
+
+        var post_id = jQuery("#post_ID").val() || 0;
+
+        if( 0 < post_id ) {
+
+            var post_data = autosave_prepare_data_to_save();
+
+            //if the content and title did not change from last server save,dont keep data in local storage
+            if ( ( post_data["post_title"].length == 0 && post_data["content"].length == 0 ) || post_data["post_title"] + post_data["content"] == autosaveLast ) {
+                autosave_delete_local_storage( post_id )
+            } else {
+                localStorage.setItem( autosaveL10n.blog_id+'_'+post_id, JSON.stringify( post_data ) );
+            }
+        }
+    }
+
+}
+
+function autosave_get_local_storage( post_id ) {
+
+    if ( window.localStorage ) {
+        return JSON.parse( localStorage.getItem( autosaveL10n.blog_id+'_'+post_id ) );
+    }
+
+}
+
+function autosave_delete_local_storage( post_id ) {
+
+    if ( window.localStorage ) {
+        localStorage.removeItem( autosaveL10n.blog_id+'_'+post_id );
+    }
+
+}
Index: script-loader.php
===================================================================
--- script-loader.php	(revision 23348)
+++ script-loader.php	(working copy)
@@ -577,7 +577,8 @@
 	wp_localize_script( 'autosave', 'autosaveL10n', array(
 		'autosaveInterval' => AUTOSAVE_INTERVAL,
 		'savingText' => __('Saving Draft&#8230;'),
-		'saveAlert' => __('The changes you made will be lost if you navigate away from this page.')
+		'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'),
+		'blog_id' => get_current_blog_id()
 	) );
 
 }
