Topic-icon Facebook login button only works with a second try

Active Subscriptions:

None
Hi Alex,

we have a problem with facebook login (via JFBConnect).
First of all, we are using:
Joomla 2.5.20, Jomsocial 3.2.1.3 and JFBConnect 6.1.2. We are running nginx server with no cache enabled at the server level.

The problem can be replicated in any browser and many of our users report it.
Basically, when you already have an account via Facebok on our site and you visit our Jomsocial homepage @ www.tanie-loty.com.pl/spolecznosc and you press the FB login button, nothing happens. Only after you press it for the second time it starts to work. Later, after you log out and then log in back again it will work immediately. But when you close the brovser and open the page again (i.e. in incognito mode) the login button will not work for the first time, only after a second try.

We thought it is connected to cache (we are uusing Jotcache component) so we switched off both Jotcache and joomla cache, but its not. We even uninstalled Jotcache but no luck. We also have sh404 component but it is switched off for jomsocial.

What we can see when we analyse page headers is that server returns 304 status after pressing the FB Login button, so the browser doesn't load the new page. We don't understand why.


Could you please look into it ASAP?
The topic has been locked.
Support Specialist
9 years 8 months ago #46667 by alzander
Artur,
Sorry for the delay. At first, I was unable to load your site completely because the DNS servers I use (Comcast in the US) weren't able to look up the address for your site. That's not a common issue. I resolved it by using Google's public DNS, but it's something you may want to look into to ensure your site is fully routed correctly.

As for your issue, the problem looks to be a browser caching issue. When a user visits your site, the site is instructing their browser to cache the contents of the page (the raw HTML). After JFBConnect logs the user in, its returning them to the same page they were on. The browser detects that it already has that page in the cache and simply shows the non-logged in view to the user.

In short, you should not use browser caching to store the output of the page when you allow users to login to your site. Browser caching for assets is fine though. I'm not sure what you're using for browser caching. It could be the setting in the System - Cache plugin or a 3rd party extension, but you'll need to disable that.

For more testing to verify that it's the browser caching the page, you can:
* After logging in, hold shift and hit the "Reload" button in most browsers. That will force the page to load without caching and you'll see that you are, in fact, already logged in without having to do it again.
* In Chrome, if you open up the developer tools, under the "Network" tab there is a checkbox for "Disable Cache". If you disable the cache, the login will work on the first try.

I hope that helps you narrow things down, but if you have any other questions, just let me know.

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

None
Hi Alex,
many thanks for your reply. This worked a treat - I disabled browser caching in the system cache plugin and "voilla!" - problem dissapeared.

Also thanks for letting me know about the dns problem - we had DNS SEC option switched on with our hosting provider "OVH". Maybe this was the cause? We will investigate this issue further.

Once again, many thanks for your help and fast reply - you made my day!
The topic has been locked.
Support Specialist
9 years 8 months ago #46681 by alzander
I'm glad to hear that worked for you. I'm not at the same computer/connection I was at yesterday, so I can't test if the DNS problem persists.. but your site is loading from the starbucks that I'm at :)

If you run into anything else or need any more help, just let me know.

Thanks,
Alex
The topic has been locked.
Support Specialist
9 years 8 months ago #46682 by alzander
Oh yeah.. if you haven't already, please consider leaving a rating and review for JFBConnect, or our support, on the Joomla Extension Directory. It certainly isn't required, but is very appreciated:
extensions.joomla.org/extensions/social-...ook-integration/7215

Thanks!
Alex
The topic has been locked.