var auth_headers = { 'X-Auth-Date': '2017-12-18 06:49:00Z', 'X-Authorization': 'gcn:14bd7df1b6b9b3539a145c9394c4d5f5870e33c62b6304e8fac9d6485ad8ecd5d3761dbe7f4409013c1552c7a5a348c11a7c07a43985425734a24fe676a915cb' } $.ajaxSetup({ 'headers':auth_headers, 'error':function (jqXHR, textStatus, errorThrown) { if (jqXHR.status == 403) { window.location.reload(); } } });