Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Facebook get user Login Status
<html lang="en" prefix="og:" xmlns:fb="">
<head><title>Hello Facebook</title></head>
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
channelURL: '//', // Channel File
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true, // parse XFBML
oauth: true // enables OAuth 2.0
// Additional initialization code here
FB.getLoginStatus(function(response) {
if (response.authResponse) {
// logged in and connected user, someone you know
console.log('you know this user!!');
} else {
// no user session available, someone you dont know
console.log('Howdy Stranger!');
// END additional initialization
// Load the SDK Asynchronously
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); = id; js.async = true;
js.src = "//";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.