Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Login with #_=_ behind URL

Facebook Login

  // Get the page we were before
  $redirect = Session::get('loginRedirect', 'hirer/account');   

The domain became this

 http://domain.com/hirer/account#_=_

What is the #= behind how do i not display it?

like image 894
CodeGuru Avatar asked Oct 08 '13 11:10

CodeGuru


People also ask

How can I log into Facebook without password and ID?

You may be able to get back into your Facebook account by using an alternate email or mobile phone number listed on your account. Using a computer or mobile phone that you have previously used to log into your Facebook account, go to facebook.com/login/identify and follow the instructions.

How can I open my old Facebook account without password?

You may be able to get back into your Facebook account by using an alternate email or mobile phone number listed on your account. Using a computer or mobile phone that you have previously used to log into your Facebook account, go to facebook.com/login/identify and follow the instructions.


2 Answers

Although this thread is old, but hope this might help someone else. I have seen some people resolve the problem by adding javascript code to the redirected page to remove the #_=_ from the location.

However, that is ugly for me. There is another way of solving this issue from back-end. You can make your redirect url to contains the your own anchor # so that it will overwrite the #_=_ added by facebook. For example, this is my Laravel's handleProviderCallback:

public function handleProviderCallback()
{
    $user = Socialize::with('facebook')->user();
    // add the user to your database if it doesn't exist

    // redirect the user to home page, the anchor # is 
    // to overwrite #_=_ anchor added by facebook
    return redirect('/#');
}
like image 199
Duc Vu Nguyen Avatar answered Sep 24 '22 12:09

Duc Vu Nguyen


Yes they append it after redirecting from Facebook. There doesn't seem to be a way to remove it from your PHP/Laravel code.

But you can remove it using Javascript like here: stackoverflow.com/a/7297873/783875

like image 43
WebNovice Avatar answered Sep 24 '22 12:09

WebNovice