× Joomla Facebook Connect support forum

Topic-icon Problems with repeat login in IE9 only

Active Subscriptions:

None
Hello,

I read all the topic and tried everything in:
www.sourcecoast.com/forums/jfbconnect/jf...ith-login-only-on-ie

but still I have this problem:

In Chrome, FF and IE8 its okay but in IE9 I can login via JFBConnect button only ONCE. Then if I logout and try to connect again it only shows a fb popup and then refreshes the page. Weird is that when I try to connect from different page the process repeats. Only the first login is succesful and then it is only refreshing the site.
I tried to disable all the plugins except the necessary ones, tried to disable all the unnecessary modules, tried to remove all unnecessary html code and scripts, httaccess, SEF... with no success.

Web: www.ziskejte.cz/ but try it from other pages too.
Joomla: 1.5.22
JFBConnect: 4.1.2
CB: 1.8

Please help me if you can.

Best regards
Werdin
The topic has been locked.
Active Subscriptions:

None
Upgraded Joomla to 1.5.26 and it seems that its worse than before. After login/logout only blank page, have to ctrl+f5 to see something. And the problem is now for all FF, Chrome and IE. Also the main problem persist. Only the first login on every page via JFBC is succesful. Reverting to 1.5.22.
The topic has been locked.
Support Specialist
14 years 1 month ago #21500 by alzander
Carlos,
Very sorry for the delayed response. I was out of town this past weekend unexpectedly, which slowed support times down a bit more than normal.

I just tried to register, and after filling out the registration form, I got a 500 server error. There are few reasons that can cause this. Can you try, or let me know, the following:
1) Unpublish all JFBCProfile plugins you have enabled. Additionally, check that any profile plugins you have enabled are for extensions you actually have installed (don't enable the Kunena plugin if you don't have Kunena installed, etc).
2) Disable the minimization/optimization extension you're using. All the Javascript on your page is pushed to the bottom, compressed together, and minimized. While normally, this should be ok, it's possible that's part of your problem.
3) If you have caching enabled, especially the System - Cache plugin, try disabling it.
4) Re-order the system plugins so JFBCSystem is toward the top. Preferably first, but there are other extensions that need to be high as well, and JFBConnect really isn't that picky.

Test with any of those, and let us know how it goes. Other than #1 (incorrect JFBCProfile plugins enabled), all issues should be able to be resolved while leaving optimization, caching, etc enabled. We just need to narrow down where the problem is first.

I do not believe that Joomla 1.5.26 vs 1.5.22 is the reason for any of the problems. It's always possible, but we definitely recommend running the latest Joomla at all times for the security improvements that each new release contains.

Again, sorry for the delay, and I'll be much quicker with future responses.

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

None
Hi Alex,

I figured out why the registration wasn't working - it needed some fixing in the code of AUP register new user plugin (comprofilerUser object) - thx I wasn't aware of this.

I deleted your account so now you can try and register again please.
ad 1) I have only the CB profile enabled because no other extension is installed.
ad 2) I was trying this before with no succes. If you wanna debug it I can disable all the optimalization again, just say.
ad 3) Disabled.
ad 4) I was trying it on the top and either on bottom with no success. Now its in order: JFBC, Joomla, Jcomments, AUP new user.

I turned off the SEF for CB (in ACESEF) for now, just to be sure there will be no other 500 error. Still there is the main problem, I can login only once on every page in IE9 via JFBC button.

Also I figured out what makes the blank page after Updating to 26. In version 23 they changed file \libraries\joomla\environment\response.php:
Line 201 from:
JResponse::setHeader( 'Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false );
To:
JResponse::setHeader( 'Cache-Control', 'no-store, no-cache, must-revalidate', true ); 	// Extra CYA
JResponse::setHeader( 'Cache-Control', 'post-check=0, pre-check=0', false );			// HTTP/1.1

But I don't understand why this is the reason. Do you know it?

Anyway I just updated to 26 and ignoring the cache change on line 201. It seems okay for now. So we can focus on the repeat login problem in IE9.

This is interesting: I just noticed that after the update to 26 the problems with JFBC connect/logout is in Chrome too. Only FF seems doing what is supposed to do.
The topic has been locked.
Support Specialist
14 years 1 month ago #21531 by alzander
Carlos,
Thanks for letting us know you figured out the registration issue. We haven't heard about changes required for AUP registration though. Can you let us know what you had to do, and where you found out that you needed to make those changes?

For the registration problem, I see what you mean. I registered and was logged in the first time. Then, I logged out. Then, I clicked Login With Facebook again and was directed to the login/registration page. I'm a bit confused as to why that would be happening. Can you check:
1) That I have a Joomla user created in the User Manager. I'm pretty sure that that user has been created based on what I'm seeing, but good to know.
2) In the JFBConnect -> Usermap area, is there a row with my username and Facebook account (or any other connections)? My guess is that this row isn't being created properly, causing JFBConnect to not detect the user when they try to login again. If the row is missing, can you re-order the User plugins so that JFBConnect is the first one. If there are other User plugins that redirect the user, that will cause issues because it can prevent our code from running.

Hopefully, that's all it is.. but please let us know.

I'm not sure about the change that you mention with joomla 1.5.26. Don't know why it would change the behavior you're seeing, or even what that code's purpose is.

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

None
Hello Alex,

sure I can:
There is one plugin in alphauserpoints (AUP) used when registering which is in file sysplgaup_newregistered.php. After registration it creates record in database (db) where it add the registering user with points and other relative data so its shown in AUP interface. First error I had was that the entry is added with duplicated user_id. I dont get it because the adding is run only once and no same user_id was in the db before. However the record is added succesfully. To fix the error message I rewrote \plugins\user\sysplgaup_newregistered.php on line 73 from:
if (!$row->store()) {
					JError::raiseError(500, $row->getError());
				}
To only:
$row->store();

Next error was worse and needs repair for registration to work. The registration link was send and when clicked there should be activation of user and another email with welcome message send. But when the registration link is typed the page was showing the error: Fatal error: Cannot use object of type moscomprofilerUser as array in ... sysplgaup_newregistered.php on line 58.
To fix it you need to edit line 58 from:
} else $newreferreid = $prefixNewReferreid . strtoupper($user['username']);
To something like:
} 
				else 
				{
					if ( is_object( $user ) ) {
						$user	=	get_object_vars( $user );
						$newreferreid = $prefixNewReferreid . strtoupper($user['username']);
					}
					else $newreferreid = $prefixNewReferreid . strtoupper($user['username']);
				}

And that's it. It cames with the CB update and for joomla 1.5.x there is no adequate update for AUP which fix this. Even though I dont know if someone else has this problem too or its just me because I didnt found it on the internet.

Back to our issue:
ad 1) Yes your account is okay.
ad 2) Every account which connected fb acc via JFBC including yours is normally created here. As I mentioned in my last post the order in which user plugins are run is:
JFBC, Joomla, Jcomments, AUP new user.
So this should be fine I think.

I noticed when I login to sourcecoast.com the link contains parameter return=... and when Im connecting to my site the parameter is missing. Could it has something to do with the problem? Now I think that this is the cause because when it only refreshes the page (click on JFBC button) the parameters are missing.

Also the function interconnect acc with fb is doing the same behavior. If it is some lead for you?

Any other suggestions?
The topic has been locked.
Support Specialist
14 years 1 month ago #21557 by alzander
Carlos,
Thanks for the clarifications on AUP and CB. Hadn't seen those changes before. We'll have to look into them more.

As for your issue, I did a bit more testing, and it seems to be a caching issue. When I watch a logger we have for our browsers, each page is usually being loaded from local cache instead of from your site. I did some testing by logging in from different pages on your site, and each time, the first login would work, the 2nd wouldn't. That's a good indicator that the response from your server is simply saying "Used the cached version of the page", which is incorrect, since the page will definitely change after a user logs in.

Please try disabling (at first) all caching. Then, clear your browsers cache. Then, feel free to try and re-enabling specific caching options in Joomla or your extensions, but -do not- enable any Browser Caching, as that's likely the culprit.

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

None
Hi Alex,

thanks for the idea but its really confusing beacuse I have all caching disabled - joomla cache in global configuration, joomla cache plugin and also jotchache. I have my site going through Cloudflare service which use caching so maybe its the source of it but already I tried to disable it and its still the same, the only solution I can try is that I will rewrite the DNS records. Then it will be not delivered by Cloudflare and maybe it will be okay. Before that I will try to configure it a bit more or set it by some other method. I will write you about the results then.

Results:
I tried to rewrite the DNS records, clered the DNS cache and still the same, cleared browser cache too, nothing helps.
Its strange that:
- in Joomla ver. 1.5.22 It was working for FF and Chrome fine.
- now in ver. 1.5.26 its working only in FF
- in Chrome you can see that the called url is the always same as the first login, parameter return is not changing: /index.php?option=com_jfbconnect&task=loginFacebookUser&return=L2Jsb2c= which is that cache problem, but I dont know what to do with it.
- tried to change the parameter "return" to something: return=2= and logged/logout succesfully, then return=3= again succesfully, so if the parameter is unique then the function is normal. Maybe some tweak in the code could provide forcing the unique return parameter every time?

What is the right configuration of fb application on their web? Maybe I have something misconfigured there.

If you have some other advices as how to disable caching or bypass this problem please write it.
The topic has been locked.
Active Subscriptions:

None
Please help.
The topic has been locked.
Support Specialist
14 years 1 month ago #21698 by alzander
Carlos,
Sorry for the delay. Your Facebook application is likely setup fine, since login and logout is working, even though it's not working all the time. It wouldn't work at all if your application was incorrect. Hwoever, in the 4.2 release (out tomorrow), there will be an Application checker tool built-in to check for common problems and give recommendations for how your app should be setup.

The issue is definitely a caching problem. I'm testing in Chrome right now, and am stuck in a situation where I can't logout of the site. Each time the page redirects me to the home page, but the cached version is being loaded. The cached version is of the page with me logged in, it looks like. The logout link itself is a bit strange since it goes to: index.php?Itemid=98. Not sure why it looks like that. May be normal, but it's not the normal link.

However, after I typed that, I tried the logout link int he SCLogin module that drops down, and that worked fine. So, not sure if it's just that link in the right sidebar, but something is strange there as well. This was in Chrome.

Anyways, going back to the original login issue, the problem is definitely an agressive browser caching scheme that is setup for your site. If you look at the image below, you'll see that the request made to our LoginFacebookUser page is simply being returned from cache:
File Attachment:

The top row is from right after clicking the Login With Facebook button. The "size" column shows that chrome is simply loading the resulting page from it's own cache instead of actually trying to send the request and execute the page.

That would explain why changing the URL fixes the issue. Since that seems to work for you, feel free to try the following change, which will make the login URL random every time a user clicks it. In the /components/com_jfbconnect/includes/jfbvconnect.js file, at line 29, you'll see:
self.location = jfbcBase + 'index.php?option=com_jfbconnect&task=loginFacebookUser&return=' + jfbcReturnUrl;
Update that line to be:
var d = new Date();
self.location = jfbcBase + 'index.php?option=com_jfbconnect&task=loginFacebookUser&return=' + jfbcReturnUrl+'&cb='+d.getTime();

You'll need to clear Joomla and browser cache when done. Hopefully, your CDN won't have the jfbconnect.js file cached either (or you'll need to clear it or wait for it to expire).

Let us know how that goes, and good luck,
Alex
The topic has been locked.