I am trying to query whether a user is logged in by using the following function:
function getCurrentUser() {
sdk.sendRequest('users/show/me.json', 'GET', null, false, callback);
function callback(data) {
if(data) {
if(data.meta) {
var meta = data.meta;
if(meta.status == 'ok' && meta.code == 200 && meta.method_name == 'showMe') {
var message = '';
var user = data.response.users[0];
message += 'Get user profile successful!\n';
message += 'first name:' + user.first_name + '\n';
message += 'last name:' + user.last_name + '\n';
message += 'email:' + user.email + '\n';
alert(message);
} else {
alert('No user');
}
}
} else {
alert('No user');
}
}
}
Unfortunately all I am getting is the following error:
I cannot find anywhere I need to add the domain into an allow access. And other functions interactions are working. I.e. I can seemingly login and logout. What puzzles me is if I am logged out, why is a session_id being passed in the url? Should the SDK not remove the session on logout?