diff --git a/src/wp-admin/post.php b/src/wp-admin/post.php index c1491340c5..2fcef19ba2 100644 --- a/src/wp-admin/post.php +++ b/src/wp-admin/post.php @@ -190,7 +190,7 @@ case 'editpost': // Session cookie flag that the post was saved if ( isset( $_COOKIE['wp-saving-post'] ) && $_COOKIE['wp-saving-post'] === $post_id . '-check' ) { - setcookie( 'wp-saving-post', $post_id . '-saved', time() + DAY_IN_SECONDS ); + setcookie( 'wp-saving-post', $post_id . '-saved', time() + DAY_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, is_ssl() ); } redirect_post($post_id); // Send user on their way while we keep working diff --git a/src/wp-includes/js/autosave.js b/src/wp-includes/js/autosave.js index 4e6834a15d..c79d5a45a1 100644 --- a/src/wp-includes/js/autosave.js +++ b/src/wp-includes/js/autosave.js @@ -286,7 +286,8 @@ window.autosave = function() { }); } - wpCookies.set( 'wp-saving-post', post_id + '-check', 24 * 60 * 60 ); + var secure = ( 'https:' === window.location.protocol ); + wpCookies.set( 'wp-saving-post', post_id + '-check', 24 * 60 * 60, false, false, secure ); }); }