Facebook supply only cached response for periodic ajax API requests

hi guys,

   In one of my web app I'm using facbook login to login my users.So what im trying to do now is forcibly logout the user if he is logged out from his facebook account in a different tab.For this im doing a periodic ajax api request to check if the user is logged in or not so if once i found that he is logged out from his fb account i can also redirect him to the logout action in my userController.php to end his session in my application.

this solution is worked fine when im hosted the app in www.pagodabox.com but not working in AWS.what happening in AWS is that I’m just getting the cached response for all api requests.so if the user logged out im still get his user details etc. normally we cant get user details if he is not logged in then only we can detect that he is logged out already.

my code:


<script type="text/javascript">


  var loginStatus=null;

        

      window.fbAsyncInit = function() {

        FB.init({

          appId      : "<?php echo Yii::app()->params['facebook_appId'] ?>",

          status     : true, 

          cookie     : true,

          xfbml      : true,

          oauth      : true,

        });


         

               FB.getLoginStatus(function(response) {

				if (response.status === 'connected') {

                  

                                  loginStatus='online'; 

                                }

                                else{

                                  loginStatus='offline';  


                                }


               });

   

        

        function checkStatus()

         {

            

           FB.api('/me', function(response) {

       

              var isGuest="<?php if (Yii::app()->user->isGuest) echo 'true'; else echo 'false'; ?>";


              if(response.name==undefined&&loginStatus=='online'&&isGuest=='false')

                {

                    

                 window.location="<?php echo Yii::app()->createAbsoluteUrl('user/logout'); ?>";

                  

                }

             

            });

      

         }

         

         setInterval(function(){  

              checkStatus();

          },5000);  


      };


    (function(d){

         var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}

         js = d.createElement('script'); js.id = id; js.async = true;

         js.src = "//connect.facebook.net/en_US/all.js";

         d.getElementsByTagName('head')[0].appendChild(js);

       }(document));


    

    </script>

Please help me to fix this issue in my AWS.Also you can suggest if you know an alternative solution for this purpose.

Thanks alot in advance.

-Sirin

[color="#008000"] NOTE: moved to proper section (General Discussion for Yii 1.1.x instead of Bug Discussion) [/color]

hi guys,

   This issue is solved when i have changed my facebook app with a new one.But still don't know what was the issue with the previous facebook app.

Thanks all for reading this issue.