In my app if URL has certain $_GET parameter I want to update session and reload page once after this AJAX update and following is my code.
if($_GET['something']){
//do something
$.ajax({
type: "POST",
url: "localhost/example/ajaxpage.php",
data: {
foo: foo_test,
bar: bar_test,
},
success: function (data) {
window.location.reload();
}
});
}
but on page reload it get $_GET again so page is being reloaded repeatedly. How can I fix this so that the page reloads only once after the AJAX update.