I am trying to call a php script which destroys session and reload a page after it.
$(document).bind("active.idleTimer", function(){
$.post("data.php?data=active");
location.reload();
});
data.php
if($_GET['data'] == 'active') {
session_destroy();
}
It does not destroy the session, only if I manually open the url data.php?data=active it does, why is that? Thanks!