$('#logout').click(function() {
$.ajax({
type: "POST",
url: "/logout",
data: {
token : '<?= $_SESSION['userToken'] ?>'
},
success: function(){
location.reload();
}
});
});
<form type="post" action="/logout" >
<input type="hidden" value="<?= $_SESSION['userToken'] ?>" name="token" />
<button type="submit">Выйти</button>
</form>