Facebook callback has started appending #_=_
hash underscore to the Return URL
Does anyone know why? What is the solution?
Facebook callback has started appending #_=_
hash underscore to the Return URL
Does anyone know why? What is the solution?
This was implemented by Facebook by design for security reasons. Here's the explanation from Eric Osgood, a Facebook Team member:
Source: https://developers.facebook.com/bugs/318390728250352/
I do not see how this problem is related to facebook AJAX. In fact the issue also occurs with JavaScript disabled and purely redirect based logins.
An example exchange with facebook:
Happens only with Firefox for me too.
For PHP SDK users
I fixed the problem simply by removing the extra part before forwarding.
I use this one, to delete '#' symbol as well.
via Facebook's Platform Updates:
To prevent this, set the redirect_uri in your login url request like so: (using Facebook php-sdk)
UPDATE
The above is exactly as the documentation says to fix this. However, Facebook's documented solution does not work. Please consider leaving a comment on the Facebook Platform Updates blog post and follow this bug to get a better answer. Until then, add the following to your head tag to resolve this issue:
Or a more detailed alternative (thanks niftylettuce):
This can become kind of a serious issue if you're using a JS framework with hashbang (/#!/) URLs, e.g. Angular. Indeed, Angular will consider URLs with a non-hashbang fragment as invalid and throw an error :
If you're in such a case (and redirecting to your domain root), instead of doing :
Simply do :