title: facebook php sdk - facebook login to my website success .. logout will log me out of facebook but not my website
body: <p>facebook php sdk - facebook login to my website success .. logout will log me out of facebook  but not my website</p>
  
  <p>i don't know why .. </p>
  
  <p>index.html </p>
  
  <pre><code>&lt;?php
  require 'facebook.php';
  
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;eNetwork | eShopping &lt;/title&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;!--[if lt IE 9]&gt;&lt;script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"&gt;&lt;/script&gt;&lt;![endif]--&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;meta name="keywords" content="" /&gt;
      &lt;meta name="description" content="" /&gt;
      &lt;link href="css/style.css" rel="stylesheet"&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  
      &lt;div class="topwrapper"&gt;
          &lt;div class="topbar"&gt;
                  &lt;?php if ($user): ?&gt;
                  &lt;a href="&lt;?php echo $logoutUrl; ?&gt;"&gt;&lt;img src="img/facebooklogout.png"  alt="Logout facebook" height="25px"&gt;&lt;/a&gt;
  
                  &lt;?php else: ?&gt;
                  &lt;a href="&lt;?php echo $loginUrl; ?&gt;"&gt;&lt;img src="img/facebooklogin.png"  alt="Use Facebook to Login" height="25px"&gt;&lt;/a&gt;
                  &lt;?php endif ?&gt;
                  &lt;?php if ($user): ?&gt;
                  &lt;?php echo "&lt;strong&gt;"."Welcome, ". $user_profile['name']."  |"."&lt;/strong&gt;";?&gt;
                  &lt;?php endif ?&gt;
                  &lt;a href="#"&gt;&lt;strong&gt;My Account&lt;/strong&gt;&lt;/a&gt;
                  &lt;a href="#"&gt;&lt;img class="facebooklogo" src="img/facebooklogo.png" height="25px"&gt; &lt;/a&gt;
          &lt;/div&gt;&lt;!-- .top--&gt;
      &lt;/div&gt;
  
      &lt;div class="wrapper"&gt;
  
  
          &lt;header class="header"&gt;
              &lt;img src="img/logo1.png"  height="80px"&gt;&lt;hr&gt; &lt;br&gt;
          &lt;/header&gt;&lt;!-- .header--&gt;
  
  
  
  
  
  
          &lt;div class="middle"&gt;
  
  
  
  
              &lt;div class="left-sidebar"&gt;
                  &lt;strong&gt;Left Sidebar:&lt;/strong&gt; &lt;hr/&gt; &lt;br/&gt;
              &lt;/div&gt;&lt;!-- .left-sidebar --&gt;
  
              &lt;div class="content"&gt;
                  &lt;strong&gt;Content:&lt;/strong&gt; 
  
  
              &lt;/div&gt;&lt;!-- .content --&gt;
  
          &lt;/div&gt;&lt;!-- .middle--&gt;
  
      &lt;/div&gt;&lt;!-- .wrapper --&gt;
  
  &lt;footer class="footer"&gt;
      &lt;strong&gt;Footer:&lt;/strong&gt; 
  &lt;/footer&gt;&lt;!-- .footer --&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>facebook.php ................................................ >>>>>>>>>>>>>>>>>>>>>>>>>>>></p>
  
  <pre><code>&lt;?php
  /**
   * Copyright 2011 Facebook, Inc.
   *
   * Licensed under the Apache License, Version 2.0 (the "License"); you may
   * not use this file except in compliance with the License. You may obtain
   * a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   * License for the specific language governing permissions and limitations
   * under the License.
   */
  
  require 'facebook-php/facebook.php';
  
  // Create our Application instance (replace this with your appId and secret).
  $facebook = new Facebook(array(
    'appId'  =&gt; 'hidden for security issues',
    'secret' =&gt; 'hidden for security issues',
  ));
  
  // Get User ID
  $user = $facebook-&gt;getUser();
  
  // We may or may not have this data based on whether the user is logged in.
  //
  // If we have a $user id here, it means we know the user is logged into
  // Facebook, but we don't know if the access token is valid. An access
  // token is invalid if the user logged out of Facebook.
  
  if ($user) {
    try {
      // Proceed knowing you have a logged in user who's authenticated.
      $user_profile = $facebook-&gt;api('/me');
    } catch (FacebookApiException $e) {
      error_log($e);
      $user = null;
    }
  }
  
  // Login or logout url will be needed depending on current user state.
  if ($user) {
    $logoutUrl = $facebook-&gt;getLogoutUrl();
  } else {
    $statusUrl = $facebook-&gt;getLoginStatusUrl();
    $loginUrl = $facebook-&gt;getLoginUrl();
  }
  
  
  
  ?&gt;
  </code></pre>
  
  <p>what might be my problem?</p>
  
  <p>because i copied the example file from facebook sdk  and reused it again :)</p>
  
  <p>even the example didn't work .. what i need to change?</p>