Fixing the issue4860. Escaping the embedded '"' in the js_output method of Morsel class.
diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py
index 03d1627..695161a 100644
--- a/Lib/http/cookies.py
+++ b/Lib/http/cookies.py
@@ -392,7 +392,7 @@
         document.cookie = \"%s\";
         // end hiding -->
         </script>
-        """ % ( self.OutputString(attrs), )
+        """ % ( self.OutputString(attrs).replace('"',r'\"'))
     # end js_output()
 
     def OutputString(self, attrs=None):