var data = { action: 'is_user_logged_in' }; jQuery.post("https://kill3rs4.usermd.net/auth", data, function(response) { if(response == 'yes') { // user is logged in, do your stuff here } else { response.redirect('/wrong'); } });