Closed (fixed)
Project:
Drupal for Facebook
Version:
7.x-3.x-dev
Component:
Canvas Pages (iframe)
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Nov 2011 at 21:51 UTC
Updated:
26 May 2019 at 11:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
giorgio79 commentedComment #2
gianfrasoft commentedsubscribe
Comment #3
Alex Savin commentedsubscribe
Comment #4
wisniewski commentedsubscribe
Comment #5
scott shipman commentedSorry for the long msg, but its a lot of debug info for you: I get the error:
Notice: Undefined variable: _SESSION in Facebook->clearPersistentData() (line 79 of /sites/all/libraries/facebook-php-sdk/src/facebook.php).when a user is not logged into facebook or the drupal app. But only in IE 8 and IE 9. Safari, Chrome and Firefox all work OK.
BUT, when I visit the apps.facebook.com/[appname] page as a logged in user to facebook, but not the application, I get the indefinate loop. Only in IE 8 and IE 9. All other browsers seem ok. I have read the forums / bug discussions on indefinate loop and presumed it was closed. I havent applied the changes to the canvas module to add the
!emptyportion yet.I followed the readme txt file correctly to install. I have allowed the application in facebook. I synch settings automatically on save of DFF settings.
I have enabled these modules:
Facebook API (7.x-3.x-dev), FB Apps, FB Connect, FB Canvas Pages, FB Dev Tools, FB User Mgmt, FB Views, FB Extended Perms, FB Registration
I clicked the checkbox to match accts by email and when both UIDs are present. All 3 session setting checkboxes are clicked. Both Canvas Page settings are checked. And I use User Friendly names.
My FB devel info is attached for 3 scenarios. No other logs in my PHP or Drupal error logs.
Comment #6
scott shipman commentedI may or may not have fixed this by adding this line to my settings.php:
header('p3p: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"');replacing the line from the readme.txt ("- Also for canvas pages, see http://drupal.org/node/933994 and search
for "P3P" to avoid a common problem on IE.")
header('P3P: CP="CAO PSA OUR"');see: http://stackoverflow.com/questions/4467326/facebook-app-works-on-all-bro... and http://www.p3pwriter.com/LRN_111.asp for info about these new p3p values.
After this change, my FBdevel Info using IE8 or IE9 matches in the Session and Cookies areas to that of other Browsers.
Comment #7
scott shipman commentedOK, new update...I still get the infinite loop issue, and I made it happen in Safari too.
Comment #8
Dave Cohen commentedHere's what apps.facebook.com/drupalforfacebook has at the end of it's settings.php...
The error that this thread is about is in facebook's php library, not modules/fb code. I personally have yet to run into it.
Are the PHP error and infinite loop related? Or is this issue about two separate things?
Comment #9
jherencia commented@Dave, the reason because this fails is:
fb_canvas on hook_exit run fb_canvas_redirect($app_destination) that executes exit(), see:
which don't let other modules to run hook_exit and worse, it prevents drupal_exit from saving the session:
The case I encounter this, was when another facebook user enter in a current session of other FB user, which deletes the session, creates a new one and redirects the user to the current path.
The problem is that the session is not saved, due to the problem explained above, so $_SESSION has no value.
I have different aproaches:
@Dave this was what I wanted to tell you in IRC, because I think it is needed to implement a better behaviour than "exit()", and wanted to know more of the current flow to see if I can provide another aproach.
Comment #10
Dave Cohen commentedYeah, fb_canvas module does some ugly stuff on hook_exit. I think the code you're referring to was ugly but harmless in Drupal 6.x. But what you point out is breaking sessions in 7.x. In an ideal world, we wouldn't have to do anything there, but since canvas pages are iframes, we are trying to change the URL of the top frame, not just the iframe. When the top frame is correct, facebook will send an up-to-date signed_request.
I would try replacing the call to fb_canvas_redirect() with just a call to echo the
<script...>. That way exit() would not be called and it might just work. I wonder which module implements hook_exit() and is responsible for doing something with the $destination?Comment #11
gianfrasoft commentedAny standard solution...?
Comment #12
fdambrosio commentedsame problem
Comment #13
Dave Cohen commented@jherencia, if I understand you correctly, this patch which uses hook_module_implements_alter might have an effect.
Do you happen to know which of your modules are also implementing hook_exit and their order? I'd like to reproduce consistently. I'm attaching a patch based on your idea but I havent' tested at all.
Comment #14
Dave Cohen commentedCommitted the patch. Hopefully fixed.
Comment #16
avpaderno