AJAX.JS:
Code:
$("#buttonLogout").click(function() {
$.ajax({
type: "GET",
url: "/assets/ajax/logout.php"
}).done(function( data ) {
alert(data);
window.location="/login.php";
});
alert("clicked");
});
LOGOUT.PHP:
PHP Code:
<?php
session_start();
$_SESSION['loggedin']=0;
$_SESSION['nick']="";
echo 1;
?>
The script doesn't alert anything and doesn't redirect me.
What I'm doing wrong?