diff --git a/resources/static/dialog/js/misc/state.js b/resources/static/dialog/js/misc/state.js
index 7f36178c5aef18b25d44053317291c585589bd16..032bd85f683c1f9a9698fcecf87af9a9ad2c5af5 100644
--- a/resources/static/dialog/js/misc/state.js
+++ b/resources/static/dialog/js/misc/state.js
@@ -62,13 +62,6 @@ BrowserID.State = (function() {
     });
 
     handleState("window_unload", function() {
-      if (!self.success) {
-        storage.setReturnTo("");
-        // do not call doCancel here, let winchan's cancel
-        // handling do the work. This gives us consistent semantics
-        // across browsers on the RP side of the WinChan.
-      }
-
       // Round up final KPI stats as the user is leaving the dialog.  This
       // ensures the final state is sent to the KPI stats.  Any new logins are
       // counted, any new sites are counted, any new emails are included, etc.