<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Inter-sections.net : The low-down on Facebook sessions</title>
    <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions.rss</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Business, Technology, Life</description>
    <item>
      <title>Comment on The low-down on Facebook sessions by Tyler</title>
      <description>&lt;p&gt;Hey,&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m working on a desktop app and want to get an infinite session. When you say &amp;#8220;Create a user with a normal sounding name, that you will use as your infinite session key user.&amp;#8221; 
Do you mean to actually register a new account on Facebook and use the infinite session key for that user as a key that can be used for other users who have added your app?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</description>
      <pubDate>Sun, 28 Oct 2007 18:37:14 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:f6d0b153-660f-4a75-813c-d0c77d23e8c2</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-32</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by daniel</title>
      <description>&lt;p&gt;Tyler:&lt;/p&gt;

&lt;p&gt;Yes, that&amp;#8217;s what I meant. The reason it&amp;#8217;s good to create a completely separate user is that then you will decouple yourself from any risk that somehow you mistakenly invalidate your infinite session key, e.g. during testing, by removing and adding the app. In a desktop app, you&amp;#8217;ll be doing most things through the infinite session key, so it&amp;#8217;ll break your whole app if it becomes invalid.&lt;/p&gt;

&lt;p&gt;Bear in mind that Facebook officially does not support what they call &amp;#8220;fake users&amp;#8221;. So be sure to make that user look like a real user so it doesn&amp;#8217;t get deleted by Facebook a few months down the line. That means, don&amp;#8217;t call it &amp;#8220;My App User&amp;#8221;. Call it something like Steve Johnson or something.&lt;/p&gt;

&lt;p&gt;Some people on #facebook advocate using your own user to set up your infinite session key, but I found it broke quite often due to some testing. It&amp;#8217;s up to you, really.&lt;/p&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;</description>
      <pubDate>Sun, 28 Oct 2007 20:10:02 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:ee410591-3e69-4419-875e-084597c7802d</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-33</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by Tyler</title>
      <description>&lt;p&gt;Hey Daniel,&lt;/p&gt;

&lt;p&gt;I was able to get my infinite session key, thanks for the help. &lt;/p&gt;

&lt;p&gt;I&amp;#8217;m using the Java Client Library (which I&amp;#8217;ve heard is terrible), but I&amp;#8217;m having a bit of a problem actually using the key. I&amp;#8217;ve grabbed the key and saved it, now when I create a new FacebookRestClient I pass the infinite key as a parameter to the constructor (instead of getting the session key by launching the browser). It keeps telling me that me key is either expired or invalid, or that my signature is incorrect.&lt;/p&gt;

&lt;p&gt;I don&amp;#8217;t suppose you have any experience with this?&lt;/p&gt;</description>
      <pubDate>Fri, 02 Nov 2007 22:22:03 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:2c59cf2b-acd5-449d-9d16-e165930d28b7</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-34</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by Tyler</title>
      <description>&lt;p&gt;BTW, you can respond by email if you prefer.&lt;/p&gt;

&lt;p&gt;Thanks for the help.&lt;/p&gt;</description>
      <pubDate>Fri, 02 Nov 2007 22:22:56 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:0a927122-548b-482f-9eab-36feb23f2648</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-35</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by dale</title>
      <description>&lt;p&gt;One more clarification question:  does rfacebook&amp;#8217;s require&lt;em&gt;facebook&lt;/em&gt;install save the returned infinite session key, or does one need to do that separately?  If so, how does it subsequently get used by rfacebook?&lt;/p&gt;</description>
      <pubDate>Mon, 12 Nov 2007 19:48:36 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:fdfdb5c8-3bab-427c-8a69-b3591ab2fcc9</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-36</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by dale</title>
      <description>&lt;p&gt;I think I can answer my own question.  From the code, it looks like require&lt;em&gt;facebook&lt;/em&gt;install doesn&amp;#8217;t do anything to preserve the session key.  &lt;/p&gt;

&lt;p&gt;However, calling activate&lt;em&gt;with&lt;/em&gt;previous&lt;em&gt;session and passing it the current fb&lt;/em&gt;sig&lt;em&gt;session&lt;/em&gt;key seems to work just fine.  Doing this before calling require&lt;em&gt;facebook&lt;/em&gt;install also avoids &amp;#8220;already installed&amp;#8221; complaints out of the F8 API under certain conditions.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m still not certain why one needs to &amp;#8220;save&amp;#8221; the session key IFF the app is a webapp.  In it is installed, F8 will always start the app, and hence on the first callback, seems like there will always be an infinite session key available to send into activiate&lt;em&gt;with&lt;/em&gt;previous_session.&lt;/p&gt;

&lt;p&gt;BTW thanks for this write-up, Daniel.  Best one out there I&amp;#8217;ve seen on a very important topic to everyone.&lt;/p&gt;</description>
      <pubDate>Tue, 13 Nov 2007 01:42:40 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:c9c7d237-ef6e-4683-8f51-b6a2edddd677</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-37</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by daniel</title>
      <description>&lt;p&gt;Thanks. I hoped it would be useful when I wrote it :-)&lt;/p&gt;

&lt;p&gt;You need to save the session key and uid so that you have a handle to get back to your users and, for instance, update their profiles, outside of a request/response context.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ll probably write an article about this sometime, but one of the key architectural decisions I made when designing our facebook app was to move the profile and action updates off the request/response path (i.e. have them running in a background process). For this, you &lt;em&gt;need&lt;/em&gt; the session key and uid to be saved in a table somewhere.&lt;/p&gt;

&lt;p&gt;The point, really, is that it&amp;#8217;s quite easy to save the key/uid, and having them saved has large potential benefits if you decide to alter the architecture of your app. So you might as well save them!&lt;/p&gt;</description>
      <pubDate>Tue, 13 Nov 2007 14:36:32 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:e3d2ed23-0eda-4f10-99ed-bd3024dca212</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-38</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by silmat01</title>
      <description>&lt;p&gt;Do you have any code that shows the work flow for using :require&lt;em&gt;facebook&lt;/em&gt;install. I am trying to write a sample app.I have not published. But I wanted to test to see how this app can be added by another user. How do I do that? Also it gives me an error &amp;#8220;You must activate the session before using it.&amp;#8221;&lt;/p&gt;</description>
      <pubDate>Sun, 18 Nov 2007 05:39:33 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:fe201bbb-d4b4-4770-8da6-a75f3084f8d7</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-39</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by stridie</title>
      <description>&lt;p&gt;I&amp;#8217;m running into an issue where facebook is telling me that some of the session keys that i store for users are invalid. (Interestingly, the only one that works is the one for MY user id)&lt;/p&gt;

&lt;p&gt;None of my users (or myself) are checking the &amp;#8216;keep me signed in&amp;#8217; check box that is shown upon adding the application&amp;#8230; Is this necessary for the stored session keys to work?&lt;/p&gt;</description>
      <pubDate>Thu, 29 Nov 2007 19:50:34 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:ac5e24b7-d05d-4733-a911-60dc6e8944ae</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-40</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by daniel</title>
      <description>&lt;p&gt;stridie:
If your application is external, then yes, they need to check the second box for their session to be infinite. In that case, fall back to your own infinite session key.&lt;/p&gt;

&lt;p&gt;If, on the other hand, your app is the kind that lives on Facebook itself rather than externally, then you should switch from requiring the &amp;#8216;facebook login&amp;#8217; to requiring &amp;#8216;facebook install&amp;#8217;, however that&amp;#8217;s done in the technology you&amp;#8217;re using. The way to do it in RFacebook is to switch from:
before&lt;em&gt;filter :require&lt;/em&gt;facebook_login
to:
before&lt;em&gt;filter :require&lt;/em&gt;facebook_install&lt;/p&gt;

&lt;p&gt;Hope this helps!&lt;/p&gt;

&lt;p&gt;Daniel&lt;/p&gt;</description>
      <pubDate>Thu, 29 Nov 2007 21:16:04 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:d347716f-8f42-4d30-98a2-86122ba3f3f8</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-41</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by tejas</title>
      <description>&lt;p&gt;hi, i m integrating drupal with facebook.&lt;/p&gt;

&lt;p&gt;to start with i want to configure drupal to use facebook.
so i need userid as well as infinite sessionID so, how can i get that IDs.
plz help me.
thanks in advance&amp;#8230;&amp;#8230;.&lt;/p&gt;</description>
      <pubDate>Fri, 30 Nov 2007 13:08:19 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:14135b2e-a3fd-4a0d-b84b-8c3dc78c18c4</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-42</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by Andrey</title>
      <description>&lt;p&gt;Hi Daniel,&lt;/p&gt;

&lt;p&gt;Why do you suggest persisting sessionkey/user&lt;em&gt;id pairs? Assume I persist them into a table &amp;#8211; however in order to use the table I&amp;#8217;d have to get user&lt;/em&gt;id through facebook login redirect anyway. Then the quesions is whether I get the sessionkey from my table or again from facebook.com. I can see some perf improvement from getting key locally, but that&amp;#8217;s pretty much it, the downside is managing an extra table and potential sync issues.&lt;/p&gt;

&lt;p&gt;Also you suggest redirecting to install URL &amp;#8211; it works great for non-app-users by bypassing login page. However the users who already have that app installed and click on that link are seeing a page telling them that the app is already installed. (redirecting to login URL causes nested iframe though with all of facebook appearing inside of app frame and then surrounded by original facebook frame ;-)
Thanks!&lt;/p&gt;

&lt;p&gt;&amp;#8211; Andrey&lt;/p&gt;</description>
      <pubDate>Mon, 03 Dec 2007 05:06:02 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:f6378db1-f14a-4085-af73-06d1c44a28b4</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-43</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by daniel</title>
      <description>&lt;p&gt;Andrey:
1) You need the session key and uid to do stuff to the user when they&amp;#8217;re not logged in (e.g. when one of their friend&amp;#8217;s actions causes an update to be required on their profile). This has nothing to do with performance.&lt;/p&gt;

&lt;p&gt;2) Requiring install and just plain redirecting to install are two different things. Only redirect to the installation page if the user has not already added the application. In RFacebook, that&amp;#8217;s done with:
before&lt;em&gt;filter :require&lt;/em&gt;facebook_install
With this, the user will only be redirected to the install page if they have not already added the app.&lt;/p&gt;

&lt;p&gt;Daniel&lt;/p&gt;</description>
      <pubDate>Mon, 03 Dec 2007 10:09:36 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:862319f5-af50-400f-a1d1-c869d9cad7e1</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-44</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by Andrey</title>
      <description>&lt;p&gt;Daniel,
Thanks for the reply.
1) makes sense. For my app is not quite applicable as I store &lt;em&gt;all&lt;/em&gt; of user data created by my app in my database, hence if a logged in user A does an action that changes some data of not-logged-in user B, I do not need a session to manipulate user B data (user B data is stored in my local tables, and all I need is his userID). &lt;/p&gt;

&lt;p&gt;Regarding (2) I am using asp.net and I have fixed the error that I have had &amp;#8211; I think conceptually it does what you suggest to do with RFacebook.
Cheers,&lt;/p&gt;

&lt;p&gt;&amp;#8211; Andrey&lt;/p&gt;</description>
      <pubDate>Tue, 04 Dec 2007 04:24:42 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:a17f4f5a-23be-4201-862a-39f0e9ee413d</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-45</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by Jason</title>
      <description>&lt;p&gt;Hi we are having MASSIVE problems with the session ID stuff &lt;/p&gt;

&lt;p&gt;Forbidden&lt;/p&gt;

&lt;p&gt;You don&amp;#8217;t have permission to access /index.phphttp://&amp;#8217;Our IP Address&amp;#8217;/get&lt;em&gt;infinite&lt;/em&gt;key.php on this server.&lt;/p&gt;

&lt;p&gt;does this get&lt;em&gt;infinite&lt;/em&gt;key.php file need any other permissions? &lt;/p&gt;

&lt;p&gt;I followed the instructions from this site 
&lt;a href=&quot;http://wiki.developers.facebook.com/index.php/Infinite&quot; rel=&quot;nofollow&quot;&gt;http://wiki.developers.facebook.com/index.php/Infinite&lt;/a&gt;&lt;em&gt;session&lt;/em&gt;howto#Step&lt;em&gt;1:_Add&lt;/em&gt;your_application&lt;/p&gt;

&lt;p&gt;But we cannot understand why it wont work&lt;/p&gt;

&lt;p&gt;PLLLLLEASE HELP!!!!&lt;/p&gt;</description>
      <pubDate>Fri, 04 Jan 2008 09:10:03 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:65255d98-7e2e-4094-93f2-27f1a67409a1</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-46</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by daniel</title>
      <description>&lt;p&gt;Jason, this looks like a PHP issue rather than a Facebook issue. Go on the #php channel on irc.freenode.net and ask for help there, they&amp;#8217;ll show you how to get your server working properly.&lt;/p&gt;</description>
      <pubDate>Fri, 04 Jan 2008 09:39:22 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:9a3899a8-0d06-4957-bed7-7d4412de2cec</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-47</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by kunal</title>
      <description>&lt;p&gt;Hi Daniel,
Excellent article and this stuff works. I am not clear about one thing, however, which is - can a user&amp;#8217;s infinite session key help him get his friend&amp;#8217;s friends or his friend&amp;#8217;s profile ? 
Will appreciate what you have to say about it. Does $facebook-&amp;gt;set&lt;em&gt;user(my&lt;/em&gt;friend&lt;em&gt;id, my&lt;/em&gt;session&lt;em&gt;key) and then $facebook-&amp;gt;api&lt;/em&gt;client-&amp;gt;friends_get( ) get my friend&amp;#8217;s friends ?? I am not sure this happens.&lt;/p&gt;</description>
      <pubDate>Mon, 18 Feb 2008 19:23:06 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:252e99a9-c9a2-4e1e-b8b2-6dc5f5b14a8c</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-48</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by Rob H</title>
      <description>&lt;p&gt;Daniel, thanks for the information.  However, if you wish for this to be the clear, definitive guide it should have at least one simple example so that everyone dees not have to interpret your words.  While I get the basis of what you are saying, there are still a lot of way to interpret it into actual code.  Would you mind providing a simple PHP example of how to fetch the session ID and user ID, properly combine them and then store and fetch a session variable?  Thank you.&lt;/p&gt;</description>
      <pubDate>Tue, 03 Feb 2009 17:28:06 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:3a898ce5-ef9a-4098-9f0f-61a4e3fc143a</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-16037</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by SL</title>
      <description>&lt;p&gt;Hi,
Any idea how session keys work with facebook connect? Lets say I add a connect login to my page and one of my users logs into facebook. Can I get the session and user ID somehow to store in my database?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</description>
      <pubDate>Sun, 03 May 2009 14:33:03 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:e6cc0520-82b8-4cb6-bd20-7627fc02df6e</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-18313</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by a+ training</title>
      <description>&lt;p&gt;hi 
i think However the users who already have that app installed and click on that link are seeing a page telling them that the app is already installed. (redirecting to login URL causes nested i though with all of appearing inside of app frame and then surrounded by original  frame ;-) Thanks&lt;/p&gt;</description>
      <pubDate>Fri, 25 Sep 2009 04:52:18 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:dbc15cbf-2a3c-43b8-a503-a5c9dadd2bf4</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-18396</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by 640-553 exam</title>
      <description>&lt;p&gt;se&lt;/p&gt;</description>
      <pubDate>Sat, 03 Oct 2009 06:03:30 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:fc81d4c9-1c4e-4781-9260-3ab0ded367d0</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-18404</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by 640-553 exam</title>
      <description>&lt;p&gt;asfa&lt;/p&gt;</description>
      <pubDate>Thu, 08 Oct 2009 09:47:27 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:ee4f5f33-acfb-4b26-881f-5ed7722a5d37</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-18416</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by landed</title>
      <description>&lt;p&gt;Great article thanks for taking the time to demystify. But how can I store this key, can i use the same table in db with aanother field or do you suggest a separate table with userID as the key ?
Thanks&lt;/p&gt;</description>
      <pubDate>Thu, 14 Jan 2010 16:13:51 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:86510bd1-e955-4f65-a73f-9da743235d7c</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-18511</link>
    </item>
    <item>
      <title>Comment on The low-down on Facebook sessions by landed</title>
      <description>&lt;p&gt;Sorry forgot to post contact details.&lt;/p&gt;</description>
      <pubDate>Thu, 14 Jan 2010 16:14:22 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:3a1922b5-4228-490e-98bc-97cc5714a8ed</guid>
      <link>http://inter-sections.net/2007/10/22/the-low-down-on-facebook-sessions#comment-18512</link>
    </item>
  </channel>
</rss>
