title: LinkedIn API - Verify the user is logged in on server-side
body: <p>I'm developing a web site which I hope to use both Facebook and LinkedIn for authentication.  Integrating Facebook has been fairly straightforward, but LinkedIn has been tripping me up a bit.  I want to be able to verify that the user is both a) currently signed in to the social network of their choice and b) my web site is authorized to access their data.  If both conditions are met, then the script will serve up the "members only" area, but if both conditions are not met, then it will take them to a generic home page where they can login using Facebook or LinkedIn.</p>
  
  <p>The Facebook PHP SDK has a very clear example of how to verify if the user is both currently logged in and connected to your application.  The LinkedIn API, on the other hand, is a bit more elusive.  I'd like to be able to take the following steps:</p>
  
  <ol>
  <li>Authorize my application to read my LinkedIn data</li>
  <li>Log out of LinkedIn</li>
  <li>Reload my application, and <strong>not</strong> be able to see the user's data.</li>
  </ol>
  
  <p>This works using the Facebook API.  However, I cannot seem to figure out how to do it using LinkedIn.</p>
  
  <p>How can I go about solving this problem?  Is it even possible to verify on the server side that the user is currently logged in with the LinkedIn API, or am I stuck with figuring out a way to do it with the JSAPI and client-side redirects?</p>