Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8674197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:38:58+00:00 2026-06-12T19:38:58+00:00

There is some unknown problem with my facebook app running on heroku Problem is

  • 0

There is some unknown problem with my facebook app running on heroku

Problem is now something with the access token. Im not sure what
It seems like something in the app corrupts my access token. Cause when I attempt to login to the app, and then use the explorer it says that im either logged out or the acces token is expired. but if I debug it, it says its valid for 2 more hours.
Also, the page fails to reload after I have logged in.

Aparently the site keeps reloading.. and updating over and over. This stops when logged in on the page

The error seems to have occured recently.. Didn’t have it last week. Im guessing the problem would lie somewhere here, but I can’t find it.
If you see anything that could give a problem please hint it out. Thanks

require_once('sdk/src/facebook.php');

$facebook = new Facebook(array(
 'appId'  => AppInfo::appID(), 
'secret' => AppInfo::appSecret(), 
'sharedSession' => true,
'trustForwarded' => true,
));

$user_id = $facebook->getUser();
if ($user_id) {
 try {
  // Fetch the viewer's basic information
    $basic = $facebook->api('/me');
 } catch (FacebookApiException $e) {
  // If the call fails we check if we still have a user. The user will be
// cleared if the error is because of an invalid accesstoken
 if (!$facebook->getUser()) {
  header('Location: '. AppInfo::getUrl($_SERVER['REQUEST_URI']));
  exit();
 }
}

 <script type="text/javascript">
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '<?php echo AppInfo::appID(); ?>', // App ID
      channelUrl : '//<?php echo $_SERVER["HTTP_HOST"]; ?>/channel.html', // Channel File
      status     : true, // check login status
      cookie     : true, // enable cookies to allow the server to access the session
      xfbml      : true // parse XFBML
    });

   FB.getLoginStatus(function(response) {
    console.log (response.status);
    //this is useful if you want to avoid the infinite loop bug
    //it only reloads page when you log in
    if (response.status != 'connected') {
        FB.Event.subscribe('auth.login', function(response) {
            // We want to reload the page now so PHP can read the cookie that the
            // Javascript SDK sat. But we don't want to use
            // window.location.reload() because if this is in a canvas there was a
            // post made to this page and a reload will trigger a message to the
            // user asking if they want to send data again.
            window.location = window.location;
            //Im using the window.location.reload()
            //window.location.reload();
        });
    }
});
FB.Canvas.setAutoGrow();
 };

  // Load the SDK Asynchronously
  (function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_US/all.js";
    fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));
</script>
<header class="clearfix">
  <?php if (isset($basic)) { ?>
  <p id="picture" style="background-image: url(https://graph.facebook.com/<?php echo he($user_id); ?>/picture?type=normal)"></p>

  <div>
    <h1>Welcome, <strong><?php echo he(idx($basic, 'name')); ?></strong></h1>
    <p class="tagline">
      This is your new app for sorting events
      <a href="<?php echo he(idx($app_info, 'link'));?>" target="_top"><?php echo he($app_name); ?></a>
    </p>

    <div id="share-app">
      <p>Share this app:</p>
      <ul>
        <li>
          <a href="#" class="facebook-button" id="postToWall" data-url="<?php echo AppInfo::getUrl(); ?>">
            <span class="plus">Post to Wall</span>
          </a>
        </li>
        <li>
          <a href="#" class="facebook-button speech-bubble" id="sendToFriends" data-url="<?php echo AppInfo::getUrl(); ?>">
            <span class="speech-bubble">Send Message</span>
          </a>
        </li>
        <li>
          <a href="#" class="facebook-button apprequests" id="sendRequest" data-message="Prøv den her">
            <span class="apprequests">Send Requests</span>
          </a>
        </li>
      </ul>
    </div>
  </div>
  <?php } else { ?>
  <div>
    <h1>Welcome</h1>
    <div class="fb-login-button" data-scope="user_likes,user_photos,user_events,friends_events, user_hometown,user_location,user_interests,user_about_me,user_education_history,friends_location,read_friendlists"></div> 
  </div>
  <?php } ?>
</header>
<section id="get-started">
 <?php 
 //echo (idx($app_get_events[1], 'id');
 ?>

</section>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:38:59+00:00Added an answer on June 12, 2026 at 7:38 pm

    what browser are you using? New Safari versions don’t accept cookies from iframes. So please check if the session is working properly, and if you can create cookies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My app has some kind of Zombie problem. (Not an NSZombie problem. Like, a
I had a problem with a thread locking up for some still unknown reason
This is not a unique problem that has not been there in the past,
There are many questions about this PersistenceException, but I have not seen some, where
Is there a way to add some kind of parameters to array (yet unknown
Are there some good resources tutorials or anyone has tried to implement a Capcha
Is there some way to define an abstract type as a parameter in an
Is there some kind of software that I can feed uploaded images to and
Is there some crucial difference in writing the registry class in MVC with magic
Is there some way to use Tuning Advisor for SQL Express? Is there some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.