var auth_headers = { 'X-Auth-Date': '2018-06-24 09:22:23Z', 'X-Authorization': 'gcn:a2264b3cb259bcf70465ce8ae3e7d9fd9d80c59e009c9b57bee09a45041849d4b3ea0ef7c9028c9ea302fbaaba3da6f45097b83aedbad0766de9c4f3eaccfb6a' } $.ajaxSetup({ 'headers':auth_headers, 'error':function (jqXHR, textStatus, errorThrown) { if (jqXHR.status == 403) { window.location.reload(); } } });