--- fb_session.inc.orig	2009-09-24 18:04:48.000000000 +0200
+++ fb_session.inc	2009-10-29 11:19:15.046875000 +0100
@@ -83,6 +83,15 @@ if ($nid && isset($_REQUEST['fb_sig_api_
    $new_session_id = "fb_canvas_{$nid}_" . $sess_key;
    $new_session_name = "fb_canvas_{$nid}_" . $orig_session_name;   
  }
+ elseif ($nid && isset($_REQUEST['fb_forms_iframe_session_id'])) {
+   // For iframe canvas when we send AHAH content, the JS open session uses a different id.
+   // In the case of an existing fb connect in the same browser, the js session use the same session id,
+   //  and we could take that session id from $_COOKIE but in the other case the session used is new and
+   //  we need to read the session id from the $_REQUEST['fb_forms_iframe_session_id'] that was added by
+   //  FB Forms module
+   $new_session_name = "fb_canvas_{$nid}_" . $orig_session_name;
+   $new_session_id = $_REQUEST['fb_forms_iframe_session_id'];
+ }
  else {
    // Try to learn session key from cookies (Facebook Connect)
    
