I am building a website using Facebook Connect and therefore using the Javascript SDK for Facebook.
Problem: when using Firefox, the page does not reload properly after logging in or logging out.
FB.Event.subscribe(
'{% if current_user %}auth.logout{% else %}auth.login{% endif %}',
function(response){
window.location.reload();
});
Obviously, this seems like a known issue (just enter โwindow reloadโ not working on firefox, and you will get many results)
More precisely, Firefox does not seem to send the correct cookie when the page reloads ...
- When I click to log in as soon as Facebook registers me and sets a cookie, Firefox does not send a cookie
- When I log out as soon as Facebook logs out and deletes the cookie, Firefox sends the cookie that was previously there.
In conclusion, I use some "cache functions".
I tried to make a workaround as described here and implemented this:
redirect_url = encodeURIComponent(window.location.href);
url = window.location.href + "account/login?redirect_url=" + redirect_url;
window.location.replace(url);
But the problem remains (cache, I think ...) Can you help me?
Thank.
source
share