// login check
function loginCheck(){
    $.ajax({
        url: "php/login_check.php",
        method: "POST",
        success: function(response) {
            if(response == "not-logged") window.location = "login.html";
        }
    })
}
loginCheck();

// logout
function logout(){
    $.ajax({
        url: "php/logout.php",
        method: "POST",
        success: function(response) {
            loginCheck();
        }
    })
}

var userId;
$.ajax({
    url: "php/read_user_id.php",
    method: "POST",
    success: function(response) {
        userId = response;
        console.log(userId)
    }
})