title: How does the Facebook 'share' button on Stack overflow work?
body: <p>I am looking to add social icons to our site, giving customers the ability to "like", tweet and share content on their facebook and twitter profiles. I have noticed to the left of this box, the facebook and twitter icons do <strong>exactly</strong> what I am trying to accomplish but I am not familiar with how to do this. Looking at the source code, there are JS references to: </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    StackExchange.ready(function() {
      var shareUrl = "http%3a%2f%2fstackoverflow.com%2fq%2f7505636%2f337690";
      var shareMsg = "Advice+integrating+Facebook+%27share%27+and+link%2fimage+capabilities+with+our+site";   
      StackExchange.share.facebook($("#fb-share-7505636"), shareUrl, shareMsg);
      StackExchange.share.twitter($("#twitter-share-7505636"), shareUrl, shareMsg);
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Our site works this way: While anybody can visit the primary site at any time, individuals can sign up as representatives with their own unique URL that acts as a referrer to give 'credit' on rewards. I have reviewed the facebook developer site and to be honest I am slightly overwhelmed. I want to give our members the ability to click a Facebook icon from within their dashboard, prompting them to post on their wall with a set image, set title, and description. I have read in the documentation this is done by setting meta tags in the head but it does not seem to matter for my site (or I am clearly doing it wrong). </p>
  
  <p>What if the URL facebook is looking for (share URL) is behind a password protected page or an area of the site which would not allow content based on a missing PHP SESSION variable?</p>
  
  <h2>Edit</h2>
  
  <p>I have also seen a lot on the net which says I have to integrate the Facebook JS SDK but then goes on to talk about authentication/permission to write on walls, etc. Yes the link to the left <strong>does not</strong> ask for permission to do anything other than to 1) log into the FB account, 2) post on the user's wall.
  <a href="http://thinkdiff.net/facebook/new-javascript-sdk-oauth-2-0-based-fbconnect-tutorial/" rel="nofollow">This site is a perfect example</a></p>
  
  <p>The link above is great but it assumes I need to authorize a 'share' which does not occur on this site.</p>