I have a Facebook Javascript that reports if a user is logged in and i want to store a session variable so that i can tell my site that the user is logged in. here it the script.
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
var uid = response.authResponse.userID; --> want to store this in a session variable
var accessToken = response.authResponse.accessToken; --> want to store this in a session variable
} else if (response.status === 'not_authorized') {
// the user is logged in to Facebook,
// but has not authenticated your app
} else {
alert("your not connected");
}
});
};
You have to fire an AJAX request to the server, passing the
accessToken, then store it on the session from your ASP code on the server. You can’t do that directly from client-side js (but you can set cookies).