I have been going round in circles for the last three days. I have followed the installation instructions, the upgrade instruction (I'm now running a cvs copy of fb from 2011/2/9 13:11 EST), and the troubleshooting guide. The situation is this: once you get logged in to the Drupal site (which is hit and miss using Facebook) and you hit the logout link, your session is reopened and you never get logged out. I looked in my logs and this is what I found:
14:50 Session closed for Mykal Funk.
14:50 Session opened for Mykal Funk.
/logout is being redirected to /node?_fb_user_fbu=10000194386xxxx (last four digits wiped out on purpose). /node?_fb_user_fbu=10000194386xxxx seems to be reopening the session. I don't fully understand the situation and am having trouble following the code. I have been working with Drupal only for two weeks.
I have found references in the forums and issue reports that the Global Redirect, Logintoboggan, and Secure Pages has conflicts with Drupal for Facebook. I have disabled each one individually and tested. I have been using IE8, Chrome, FF3, Safari (doesn't like at all), and Opera 11 all for the Windows platform. The behavior of the issue has been consisted and persistent across browsers. If I disable fb.user or fb.connect the problem goes away. So does the functionality that I am seeking.
I am using Secure Pages (because of SSL), Boost, Logintoboggan, and a few other modules. No matter what I enable or disable the behavior remains. I've checked to see if this is a caching problem, but I don't think so. Any suggestion would be helpful.
I put this issue report at a priority of "critical" because it effects the login/logout process. Not a security issue exactly, but important. Feel free to change it if you disagree.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | cyberatory_net-dblog.jpg | 105.3 KB | mykalfunk |
Comments
Comment #1
forexpivots commentedI have the same problem.
I log out, but if I go to Facebook and log into my account it seems that Drupal for Facebook "picks this up" and log in automatically!
Comment #2
mykalfunk commentedThat would be somewhat expected. Facebook uses single session logins. Meaning, you log into one page and you are automatically signed in for all pages. Drupal for Facebook, in essence, merges your site's user account system with Facebook. That is my understanding. What I am experiencing is an immediate refresh of the page on logout (expected) and then my closed session is reopened (unexpected and potentially dangerous, especially on a shared or public computer.)
I continue to look for a solution other than disabling the fb_user.module. Any help would be appreciated.
Comment #3
Dave Cohen commentedmykalfunk, can you still reproduce with the latest 6.x-3.x-dev? Can you reproduce this on www.drupalforfacebook.org? I'd like to fix it, but don't understand the cause.
Comment #4
Dave Cohen commentedforexpivots, the "single-sign-on" is a feature not a bug. When logged into facebook, you are logged into all facebook connect apps you've authorized.
Comment #5
mykalfunk commentedDave, I just uploaded the newest dev version to my site. The misbehavior has disappeared, mostly. I resynced my fb properties. It gave me the correct values for https rather than http. However, I am now getting a "Session hijack attempt detected for user Mykal Funk!" error in my dblog report whenever I log out. That would be the Secure Pages Hijack Prevention module, part of the Secure Pages project. I tried to disable the Secure Pages Hijack Prevention module, but it just returned with the old behavior of closing and reopening the account.
I changed the category and the priority since I don't think we're looking for a bug exactly. Somehow Secure Pages is not playing nice with Drupal for Facebook. I will need to investigate some more. Dave, any ideas as to what to do and where to look? I'm going to scour the issue queue for the Secure Pages project, in the meanwhile.
Comment #6
mykalfunk commentedCorrection: the Secure Pages Hijack Prevention module is its own project.
Comment #7
forexpivots commentedThanks for the explanation Dave.
As usual, you're very helpful!
Cheers.
Comment #8
Dave Cohen commentedHmmm, there are some places where modules/fb mucks with the session. It tries to clean it up when it detects a logout from facebook. Where it does that, I've usually based the code on little snippets from elsewhere in drupal. If it is doing something wrong it is news to me, but would not suprise me too much. What exactly is does the hijack prevent module detect that makes it think something is going wrong?
Comment #9
mykalfunk commentedI'm not too sure what it is detecting. I'm currently experimenting with setting the session.cookie_secure to true and disabling the hijack prevention module. I'm getting all sorts of access denied errors to sort through. I am also rereading the README.TXT file and other documentation in case I missed something. I attached a screenshot of one minute of my dblog where I'm attempting to log out -- today at 11:51 am -- before I started messing with the session.cookie_secure setting.
Thanks for you time, Dave.
Comment #10
mykalfunk commentedI've gotten the stubborn thing to log in, but once I do I'm redirected back to the home page, Without any evidence of being logged on! Even my admin account logs in funny, and it is not hooked to a Facebook account. I have set session.cookie_secure to true and added an if statement to change my $base_url to "https://" if it detects a secure server. These were added to my settings.php I also disabled the Secure Pages Hijack Prevention module. You don't really need it if you are enforcing secure cookies.
If I directly input /user/login in the address bar I am sometimes can be redirected to a user account not hooked to Facebook. If I use a link it gives me the address of "node?_fb_user_fbu=10000194386xxxx" no matter which browser (IE, FF3, Chrome) I'm using. I continue to search for answers but any help would be appreciated.
Comment #11
joshuabud commentedI'm seeing a FB.getLoginStatus() called before calling FB.init() when I select logout. I logged out of FB and the canvas app doesn't log out no matter how many times I select logout in the canvas.
Comment #12
mykalfunk commentedI upgraded to 6.x-3.0-rc8 (I used update.php). I have disabled SSL, Secure Pages, Boost, LoginToboggan, Global Redirect, Path Redirect, Toggle WWW, and I unchecked the "Set FB Cookie" setting one at a time. What other modules don't work right with Drupal for Facebook? The session.cookie_secure flag is set to false. Unsetting the FB Cookie made it so I could log out, but now when I click the Facebook connect button, nothing happens. I have cleared cookies and cache. I have read the README.TXT twice, ran every search query I can think of, and I am not any closer to a solution.
JoshuaBud, are you using your site as a canvas page within Facebook or as a standalone site using Facebook for authentication? I'm using Facebook for authentication purposes. I'm interested in knowing if your problem relates to mine in some fashion. That might be a productive troubleshooting path if it is.
Comment #13
DerTobi75 commentedI also got that logout problem!
When I try to logout from my website, it logout from FB but I am still logged in on my website!
Regards,
Tobi
Comment #14
mykalfunk commented"I read the README.txt from start to finish." I have added the block of code to my settings.php file. I was inspecting the console on Firebug and Chrome. The console reads "FB.logout() called before calling FB.init()". This is similar to issue #940018: FB Connect Unstable: FB.login() called before calling FB.init(). I am also getting a "Drupal.settings.fb is undefined" occasionally.
I don't know how to reproduce this other that to say I'm using a stock 6.20 core, Drupal for Facebook 6.x-3.0-rc8, and numerous other contributed modules. If I need to list them, please say so.
I have re-enabled all of the modules and reset the "Set FB Cookie" setting. I am getting the following behavior: logout, page refreshes, sometimes with an access denied page shows up, navigate to <front> and I'm still logged in.
Comment #15
Dave Cohen commentedmake sure you've got at least rc8 or the dev release after rc8...
Look in your page source for any extra references to all.js. There should be only one, in the page footer.
Comment #16
mykalfunk commentedThanks Dave for the pointer. I'm closer to getting it to work. I found two references to all.js in the page source. I had pasted some code for a like box into a block and ran that in the footer region. Once I disabled that, the behavior changed noticablly. Here is a summary of what is happening in each browser I've tested in.
IE: Everthing seems normal
FF3: Login is as expected. The Status Report says that the session is closed than it is immediately reopened on logout.
Chrome: I login but have to refresh the page manually to see that I am logged in. Logout is as expected.
Opera: Logs in like Chrome, and logs out like FF3.
Safari: Nothing works.
I am also getting a "fb_ajax_event called badly. Not passed apikey" error. The location is "https://www.cyberatory.net/live/fb/ajax/session_change" and the referring url is"http://www.cyberatory.net/live/user/login?destination=node". It also gave a trace:
I can't make heads or tails of this behavior. I will continue to look around for more info on this problem. Any more insights?
Comment #17
krem commentedHaaaaaaaaaaaa !!!
Getting crazy with this problem... I think this weekend I'm going to reinstall a whole drupal site with a new facebook app, and enable one by one every module cos' I can't find anything wrong looking at the code of dff.
We need to find the solution ! Keep looking guys !!!
Comment #18
joshuabud commentedLogout is working fine with latest dev version after I removed a script call from page.tpl.php. I wasn't able to find the doc reference to link to for example, sorry. It was the all.js?xfbml1 in the page.tpl.php that was causing almost all of my issues.
Comment #19
Dave Cohen commentedmykalfunk, if you can reliably reproduce the "fb_ajax_event called badly. Not passed apikey" problem, please tell me exactly how (preferably in another issue). When you say nothing works in safari, could be third-party cookie issues. I try to handle it, but it is tricky. Under admin >> site building >> Facebook Apps >> Settings, do you have "store tokens in session" checked?
Comment #20
c4antonio commentedsubscribe
Comment #21
Dave Cohen commented#1022932: Local user can't log out when offline_access permission is set
consolidating threads.
Comment #22
test1111 commentedHello all,
I have face problem with fbconnect module.
This issue is form my custom theme.I have alter the login block to match with my site design. Now when i connect with my facebook account i can connect with my site properly. But when i try to logout from my site at that time i am not going to logout from the facebook. Even i have set from admin that ask to logout from facebook to user.
When i use garlend them then its work proper for the signout process I.E at that time it will ask me that would u like to logout from facebook...
One more thing if i enable the fast registration process form admin panel then i can not get any registration confirmation mail in my given email address....
I have almost try all the given solution provided by various form.. And even all thing are configured well. And also add the required code in my page.tpl.php , page-front.tpl.php.
But still problem with my logout process of custom theme.
Please help..
Thanks in advance.
Comment #23
vkr11 commentedsubscribe
Comment #24
sibani commentedHi
I have a major issue regarding the logout. I am using latest "drupal for facebook" module and I am using drupal 6.
In my system, I logged into facebook properly using fconnect in login page but when I am attempting to logout by clicking the "/logout" link, it logs me out of facebook site, but in my drupal site the logged in user's session is reopened and the user is never getting logged out. However on debugging, I found this in logs:
and it continues to replicate. Also page loading continues in my site as if in some continuous loop.
I have gone through the readme.txt section and disabled Global Redirect module and also applied other settings specified there.
Please help me out of this ASAP.
Comment #25
Dave Cohen commentedLook for an open issue similar to yours. If you can't find it, submit a new one. Don't open issues that have been closed for months.
Comment #26
m_z commented@sibani: There is a similar issue at http://drupal.org/node/1396590 where you could post your findings.