diff --git a/js/escape-admin.js b/js/escape-admin.js
index 1dc37bf..c031147 100644
--- a/js/escape-admin.js
+++ b/js/escape-admin.js
@@ -16,19 +16,20 @@
 Drupal.behaviors.escapeAdmin = {
   attach: function (context, settings) {
     var escapeAdminPath = sessionStorage.getItem('escapeAdminPath');
+    var windowLocation = window.location;
 
     // Saves the last non-administrative page in the browser to be able to link back
     // to it when browsing administrative pages. If there is a destination parameter
     // there is not need to save the current path because the page is loaded within
     // an existing "workflow".
     if (!settings.currentPathIsAdmin && !/destination=/.test(window.location.search)) {
-      sessionStorage.setItem('escapeAdminPath', settings.currentPath);
+      sessionStorage.setItem('escapeAdminPath', windowLocation);
     }
 
     var $toolbarEscape = $('[data-navbar-escape-admin]').once('escape-admin');
     if ($toolbarEscape.length && settings.currentPathIsAdmin) {
       if (escapeAdminPath !== null) {
-        $toolbarEscape.attr('href', settings.basePath + escapeAdminPath);
+        $toolbarEscape.attr('href', escapeAdminPath);
       }
       else {
         $toolbarEscape.text(Drupal.t('Home'));
