I have this php script and I'm having problems destroying the session:
<?php
session_start();
if(isset($_SESSION['id_client']) && isset($_POST['ok'])){
session_destroy();
echo 1;
}
?>
I get this warning:
Warning: session_destroy(): Session object destruction failed in C:\xampp\htdocs\template\nota\finalizare_nota_mobil.php on line 6
When I simply use...
<?php
session_start();
session_destroy();
?>
...it works. Any ideas?
EDIT: Actually the second one works if I call it from another location (I should mention that I call the first script from a jQuery post)
EDIT2: Kind of tracked the issue to the jQuery $.post, but I don't get why. Here is the code:
$.post("../template/nota/finalizare_nota_mobil.php",{ok:1}, function(data, textStatus,jqXHR){
if(data==1){
alert("Total: "+totalPartial);
window.location.href="http://qr-menu.ro/";
}
});