Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FB.getLoginStatus is returning status 'unknown' even when the user is logged in

I have third party cookies enabled so that's not the problem. I'm using google Chrome, facebook javascript SDk version 2.5, everything is working the first time when I login, but when I log out and try to log back in, it's returning status: 'unknown'

like image 585
Rockstar5645 Avatar asked Oct 26 '25 16:10

Rockstar5645


1 Answers

Use the following code after logout to resolve the issue:

document.cookie.split(";").forEach(function(c) {
    document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";domain=.example.com;path=/");
});

Replace example.com with your domain name.

like image 73
user2988855 Avatar answered Oct 29 '25 08:10

user2988855



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!