× Joomla Facebook Connect support forum

Topic-icon Jomsocial logout button

Active Subscriptions:

None
14 years 5 months ago #17723 by Ivan
Jomsocial logout button was created by Ivan
Hi,

What I am trying to do is remove the logout button from the jfblogin module and then just have the logout option from jomsocial.

However Im having an issue where if i logout via the jomsocial logout button on their toolbar it autoconnects the user again. I am not logged into facebook main site and it does this. I thought it was because i was loged into facebook and logged into my site with jfbconnect, however I am logged out of Facebook but logged into my site and when i click on the jomsocial logout icon it just reconnects me automatically and shows : Facebook API Error: An active access token must be used to query information about the current user. 2 times

I've tried to add the fb logout javascript code

input id="jfbcLogoutButton" class="button" type="submit" onclick="javascript:jfbc.login.logout_button_click()" value="Logout" name="Submit"



to the onclick event of the jomsocial logout icon but it doesnt seem to work.

a class="jsIr" onclick="document.communitylogout.submit();" title="Logout" href="javascript:void(0);">Logout

Ive tried this but no luck

www.sourcecoast.com/forums/jfbconnect/jf...fbc-login-and-logout
but the link doesnt work
The topic has been locked.
Support Specialist
14 years 5 months ago #17730 by alzander
Replied by alzander on topic Jomsocial logout button
Can you post the page you're seeing this issue on? We can take a look, but not sure why our logout code wouldn't be working.. or why it'd be trying to log you back in automatically if the logout code is working.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 5 months ago #17747 by Ivan
Replied by Ivan on topic Jomsocial logout button
Ive sent you the link in your PM
The topic has been locked.
Support Specialist
14 years 5 months ago #17761 by alzander
Replied by alzander on topic Jomsocial logout button
Ivan,
The page you sent via PM doesn't seem to have any updates to the logout button from JomSocial. I'm still seeing their standard logout form and the Javascript call to their logout action. Did you revert the update?

The post you linked to would be the same advice we'd give: remove their form, add our custom logout button wrapped around their logout icon.

If you get that implemented again and it still doesn't work, we'll gladly help you figure out what's missing.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 5 months ago #17849 by Ivan
Replied by Ivan on topic Jomsocial logout button
Alex, ive sent you another PM. Ive made the changes on my site please let me know if you find anything wrong
The topic has been locked.
Support Specialist
14 years 5 months ago #17851 by alzander
Replied by alzander on topic Jomsocial logout button
Ivan,
I looked at your site a little bit ago. The code seems correct. For some reason, the Facebook Javascript library isn't properly deleting the user cookie that tags the user as being logged in.

Have you made any changes to JFBConnect? We've never seen this issue, and aren't sure what could be causing it. The user is properly being logged out of Facebook, so that part is working properly. It's up to Facebook to destroy that cookie, but changes in JFBConnect could prevent Facebook from doing that properly, so we'll need to know what has changed.

The only suggestion I can possibly give is to update your Facebook Application and change the domain to take off the subdomain your using and do the same for the site URL. That should work for any subdomains, like you're using it on, and may help Facebook properly see and remove that cookie. Also, I know at one point, you were using a multi-site system to use one Joomla installation for multiple subdomain sites. Is that still being used? Can you test this on the 'main' Joomla site and see if you have the problem there?

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 4 months ago #17913 by Ivan
Replied by Ivan on topic Jomsocial logout button

USER wrote: The only suggestion I can possibly give is to update your Facebook Application and change the domain to take off the subdomain your using and do the same for the site URL.


Hi,

Alex, both domains are facebook apps. My main domain is already a facebook app so Im not sure i understand what you mean. In previous versions of jfbconnect i had to hard code the logout url so that it logs out. I havent noticed or found in code where this is to logout. In the javascript code i've tried to hard code it but it doesnt work.

Where can i see where its destroying the cookie?
The topic has been locked.
Support Specialist
14 years 4 months ago #17947 by alzander
Replied by alzander on topic Jomsocial logout button
Ivan,
The Facebook Javascript is what's deletes the cookie. We tell it to log the user out of Facebook (FB.logout in our jfbconnect.js file). It then logs the user out of Facebook, deletes the cookie, and then let's the rest of our Javascript execute which then redirects the user to our logout functionality for logging out of the site and redirecting.

Your site isn't loading for me now, so I can't see the Javascript for what you've changed. If you've updated the jfbconnect.js file though, please revert those changes and try again to see if that fixes your issues.

Hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 4 months ago #17973 by Ivan
Replied by Ivan on topic Jomsocial logout button
Hi Alex,

I updated the domain to my main domain and removed the subdomain from the developers page. Howver it still doesnt log me out. This time though i done get the invalid token error. I just signs me in again.

Please take a look my site is loading now.
The topic has been locked.
Support Specialist
14 years 4 months ago #17974 by alzander
Replied by alzander on topic Jomsocial logout button
Ivan,
In the HTML on the page is the following output from JFBConnect:
var jfbcLogoutFacebook = false
That seems to indicate that your setting for "Logout of Joomla Only" is set to Yes. If you want to log the user out of Facebook, that will need to be "No".

Hope that helps,
Alex
The topic has been locked.