title: FB.logout Issue, FB.getLoginStatus() returning unknown status
body: <p>I am trying to get the FB.logout() functionality working.</p>
  
  <p>Then error I get is FB.logout() called without an access token.
  so I googled around to find some solutions. So I found that we have to get the status and try then. So when I try to getLoginStatus(). the authResponse is Null, status is unknown.</p>
  
  <p>So I don't know what's the reason that I am not getting the authResponse.</p>
  
  <p>I am attaching my code.</p>
  
  <p>Controller.js</p>
  
  <pre><code>app.controller("dashboardCtrl",["$scope","authFactory","$location",function($scope,authFactory,$location){
  var userObj = authFactory.getUserObj(userObj);
  console.log(userObj);
  
  var accessToken = authFactory.getAccessToken();
  console.log(accessToken);
  $scope.accessToken = accessToken;
  
  $scope.FBout = function(){
  
      FB.getLoginStatus(function(response) {
          console.log(response);
          if (response.status === 'connected') {
  
              var uid = response.authResponse.userID;
              var accessToken = response.authResponse.accessToken;
  
              FB.logout(function(response) {
                  authFactory.clearCookie();
  
              });
          } else if (response.status === 'not_authorized') {
  
          } else {
          }
      });
  };
  }]);
  </code></pre>
  
  <p>factory.js</p>
  
  <pre><code> app.factory("authFactory",["$cookies","$location",function($cookies,$location){
  var authFactory = {};
  
  authFactory.setAccessToken = function(accessToken){
      $cookies.put("accessToken",accessToken);
  }
  
  authFactory.getAccessToken = function(){
      return $cookies.get("accessToken");
  }
  
  authFactory.getUserObj = function(){
      var userObj = $cookies.get('userObj');
  
      if(userObj){
          return userObj;
      }
      else {
          console.log("error");
      }
  }
  
  authFactory.clearCookie = function(){
      $cookies.remove("accessToken");
      $location.path("/")
  
  
  }
  return authFactory;
  }]);
  </code></pre>
  
  <p>I am not able to logout and redirect to someother page. I am stuck, I have accesstoken, and user object in the cookie. </p>
  
  <p>I am sure I have unchecked the thirdparty app access thing in chrome settings. </p>
  
  <p>Updating with another controller where I logged in, which might be required.</p>
  
  <pre><code>app.controller('homeCtrl',["$scope","authFactory","$location","$cookieStore",function($scope,authFactory,$location,$cookieStore){
  $scope.name = "login Please";
  
  $scope.FBLogin = function(){
  
      FB.login(function(response) {
  if (response.authResponse) {
   console.log('Welcome!  Fetching your information.... ');
   FB.api('/me', function(response) {
  
     console.log('Good to see you, ' + response.name + '.');
     $cookieStore.put("userObj",response);
     var accessToken =  FB.getAuthResponse().accessToken;
    authFactory.setAccessToken(accessToken);
  
    $location.path("/dashboard");
    $scope.$apply();
   });
  } else {
   console.log('User cancelled login or did not fully authorize.');
  }
  });
  
  };
  
  }]);
  </code></pre>
  
  <p>this is my Route.js</p>
  
  <pre><code>app.config(["$routeProvider",function($routeProvider){
  $routeProvider
      .when("/",{
          templateUrl : 'views/home/login.html',
          controller : 'homeCtrl'
      })
  
      .when("/dashboard",{
          templateUrl : 'views/home/dashboard.html',
          controller : 'dashboardCtrl',
          authenticated : true
      })
  
      .otherwise('/',{
          templateUrl : 'views/home/login.html',
          controller : 'homeCtrl'
      })
  
  }]);
  
  app.run(["$rootScope","$location","authFactory",function($rootScope,$location,authFactory){
  $rootScope.$on('$routeChangeStart',function(event,next,current){
      if(next.$$route.authenticated){
          var userAuth = authFactory.getAccessToken();
          if(!userAuth){
              $location.path('/');
          }
      }
  });
  }]);
  </code></pre>