This popup you say is because they used the javascript SDK to log in with Facebook, not PHP , which is your case.
In your case you can do the following, in the Facebookredirectloginhelper method you pass the same URL of the login page and in it you check if the user is coming from a Facebook login as well as if it is already logged in.
For example, Facebookredirectloginhelper on an index.php would look like:
$helper = new FacebookRedirectLoginHelper('http://seusite/index.php');
...
and in itself to receive/verify the user back from the Facebook login page:
if ( !empty($_GET['code']) ){
...
$helper = new FacebookRedirectLoginHelper('http://seusite/index.php');
try {
$session = $helper->getSessionFromRedirect();
} catch
...
- when Facebook returns from login it brings this GET variable
Ps.: Logging into Facebook using the javascript SDK is extremely productive when possible.