When calling FB.getLoginStatus using a valid Facebook App the response status is always stranger. claim response is { authResponse : undefined, condition : “ stranger ” } .
<
body
> <
div
id
="fb-root"
> div
>
< script
> window
.fbAsyncInit = function
() { FB.init ( { appId
: '1484134468466778'
, status
: true
, cookie
: true
, xfbml
: true
} ) ; FB.getLoginStatus ( function
(response
) { console
.log ( response ) ; } ) ; } ; ( function
(d
) { var
j, id = 'facebook-jssdk'
; if
( d.getElementById ( idaho ) ) { return
; } j = d.createElement ( 'script'
) ; js.id = id ; js.async = true
; js.src = "//connect.facebook.net/en_US/all.js"
; d.getElementsByTagName ( 'head'
) [ 0
] .appendChild ( joule ) ; } ( document
) ) ; < phosphorus class= '' hljs-name '' handwriting>
< p class= '' hljs-name '' body>
model URL : hypertext transfer protocol : //media.tuentifotos.com/simple_test.html
here a screenshot of the Facebook App Settings.
|| Source Asked By : Diego Cerdan Puyol
Answer # 1 :
This was happening for me in Chrome, and was because Chrome was configured to block third-party cookies and data .
once I made that shape change, FaceBook is able to log me into my app without a problem .
- Chrome Settings
- Show advanced settings…
- Privacy
- Content settings…
- uncheck Block third-party cookies and site data
Answered By : Flimzy
Answer # 2 :
I excessively faced this problem in Chrome. however, in Firefox it worked as expected with the status returned as connected
when the exploiter had logged in previously .
I found a clue about this from an answer to the exchangeable interview here .
The settle cause of this return is, on FB.logout()
, Chrome is not removing the cookie fblo_
which is somehow feign FB.getLoginStatus()
affair to return unknown
fix : On calling FB.logout()
, you may programmatically delete the cookie fblo_
FB.logout( function
( response
){
deleteCookie( `` fblo_ '' + fbAppId);
});
function
deleteCookie
( name
){
document.cookie = name + '= ; Path=/ ; Expires=Thu, 01 Jan 1970 00:00:01 GMT ; ';
}
Answered By : Nagesh Andani
Answer # 3 :
When I checked, the condition is showing "not_authorized"
and that ‘s all right, since I ‘ve not authorized the app so far .
To complete the flow, you should add the FB.login
whenever user idaho is not authorized or not logged-in to facebook :
window.fbAsyncInit = function
( ) {
FB.init({ appId: ' { APP-ID } ', status: true, cookie: true, xfbml: true});
FB.getLoginStatus( function
( response
){
if (response.status === 'connected ') {
} else if (response.status === 'not_authorized ') {
login();
} else {
login();
}
});
};
function
login
( ){
FB.login( function
( response
){
if (response.authResponse) {
} else {
}
});
}
Answered By : Sahil Mittal
Answer # 4 :
For me this meant “ on my login page ” I needed to specify cookies .
window.fbAsyncInit = function
( ){
FB.init({
version: 'v2.8 ',
cookie : true,
});
};
But do n’t ask me why this was the case. It besides fixed it needing to click doubly on the login clitoris to actually login, and does n’t even require an appId, apparently, FWIW …
Answered By : rogerdpack
Answer # 5 :
The final answer
Ok sol I think I ‘ve ultimately figured this bloody consequence out .
What you need to know :
1 ) You authenticate with Facebook via an app ID. This sets versatile cookies, where your app ID is tagged on the end :
- fblo_000000000000
- fbm_000000000000
- fbsr_000000000000
2 ) If you delete these cookies, you’re still authenticated to facebook as a regular user ( unless you log out completely ). And on Facebook ‘s servers they still know you are authorized on this app .
- So when you run
FB.getLoginStatus()
again it will just recreate them and put them back again. This is not what your user expects. This is bad. They clicked ‘Log out’.
3 ) The doctor explicitly say this :
The drug user is either not logged into Facebook or explicitly logged out of your application so it does n’t attempt to connect to Facebook and therefore, we do n’t know if they ‘ve authenticated your application or not. ( strange )
So they do n’t even TRY to check if this cookie is set. That ‘s why you get nothing or undefined. So the fblo
cookie is considered like an ‘opt-out ‘. You’re NOT ACTUALLY LOGGED OUT by what any regular person would consider being logged out as to mean. There’s just a cookie saying you are! Of course if the exploiter logs second in with the login clitoris then the cookie will be deleted, which is what you and your drug user wants .
therefore I believe the merely thing that makes sense to do ( if you truly need to know the drug user ‘s status ) is to :
- Manually check the existance of
fblo_
cookie before you runFB.getLoginStatus
. - If the cookie doesn’t exist then do nothing and run your normal flow.
- If the cookie does exist you have several options :
1 ) choice 1
Do absolutely nothing. You now understand the offspring, you understand not to delete the cookie and possibly you do n’t need to do anything early than show the Facebook login clitoris .
2 ) choice 2
You assume the person is a exploiter of your app, and do whatever you need to do to show the UI. But you wo n’t be running your broad normal logic – this will be lotion specific to you .
3 ) choice 3
- Manually set the cookie value
fblo_
ton
(instead of ‘y’). Remember this cookie is set on your domain so you’re allowed to change it. *Depending upon your development environment this will vary, but it needs to be done client side, and you may need to specify path of `/’ and your cookie domain). - Run the
getLoginStatus(..., true)
– it will not be blocked now because the cookie is nown
. However you must not run your normal logic here – because all you want to do is check if the user is actually a Facebook user and/or still authenticated with your app. - Manually set the cookie value back to
y
Unfortunately I can’t recommend this solution due to weird race conditions. It about about works, but FB could measuredly or incidentally break it at any clock – and it actually ends up hush getting confused remember you ‘re actually logged in when you are n’t. Plus it could have all kinds of complications with other plugins I have n’t evening observed .
I wish the getLoginStatus
would good always run and give accurate data, but this is the only true solution I see. And it ‘s been this way for 8 years so I think we ‘re stuck with it .
4 ) option 4 – Set your own cookie
- You always have the option to set your own cookies to indicate certain things, like ‘this user has at some point logged into Facebook’ or ‘this user is authenticated with my app’. But I’m cautious about doing this because it can quickly get complicated.
incidentally I revisited this issue because I ‘m using the Messenger plugin for my web site and I do n’t want it to display at all unless I know the person has a Facebook account. So I need an accurate response to login status .
Answered By : Simon_Weaver
Answer # 6 :
This was happening to me until I turn on my browser to allow third-party websites to save and read cookies .
To do this go to
settings > advanced > site settings > Cookies and site data
then uncheck the option blocking third-party websites from saving and reading cookies. This might not be a full choice but it solves these issues for me.
Answered By : Emmanuel David
Answer # 7 :
I had the lapp issue in IE. Flimzy ‘s answer got me thinking. I tried running IE as administrator and it worked .
Answered By : Dennis Calla
Answer # 8 :
I had the like problem, I fixed this by clearing all hoard and cookies .
Answered By : divyanshu
Answer # 9 :
You have to test it from the live domain ( which you provided in the app ) .
I had the lapp trouble when testing locally ( using local domain ) .
Answered By : magento4u_com
Answer # 10 :
In my case I was using Brave browser which did n’t allow cookies due to which it was giving status obscure. I switched to chrome and immediately it is working .
Answered By : Krissh