var auth_headers = { 'X-Auth-Date': '2018-12-17 08:35:50Z', 'X-Authorization': 'gcn:37519d9a9f61b4eab48dd04799ffd0724c47e192e63e87eccb8a4fe8e8a02755dd5e564d33b348aed42b751d036d3691785c96b87fee2f13a2153bc03685a0b8' } $.ajaxSetup({ 'headers':auth_headers, 'error':function (jqXHR, textStatus, errorThrown) { if (jqXHR.status == 403) { window.location.reload(); } } });