title: Session Key & Access Token in Facebook-API
body: <p>Can someone please explain to me once and for good what are Session Key &amp; Access Token?
  How do I catch those two? Why and when do I need to use them? When it is 'one-time' and when it is not?</p>
  
  <p>Also, what are the differences between them.
  Please do it in Java. I'm a new-to-facebook-API Java developer who's trying to get his application to work with Facebook.</p>
  
  <p>This is my basic code so far:</p>
  
  <pre><code>FacebookJsonRestClient client = new FacebookJsonRestClient(API_KEY, SECRET);
  HtmlDisplay HD = new HtmlDisplay("http://www.facebook.com/login.php?api_key=1668a3eee255c05918c4234bc4371beb&amp;connect_display=popup&amp;v=1.0&amp;next=http://www.walla.co.il&amp;cancel_url=http://www.facebook.com/connect/login_failure.html&amp;fbconnect=true&amp;return_session=true&amp;session_key_only=true&amp;req_perms=user_photos,publish_stream,offline_access");
  hd.popUp();
  client.auth_getSession(token, true);
  System.out.println(client.getCacheSessionKey());
  </code></pre>
  
  <p>I also tried to put</p>
  
  <pre><code>&amp;auth_token=TOKEN
  </code></pre>
  
  <p>inside HD and get it with</p>
  
  <pre><code>CLIENT.auth_createToken();
  </code></pre>
  
  <p>Nothing works. Thanks</p>