Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Login "Keep me logged in to" Not working

Tags:

c#

facebook

oauth

I'm integrating Facebook login into my C# Desktop Application. I use facebook login by opening the following url in a webview.

https://www.facebook.com/dialog/oauth?client_id=&redirect_uri=https:%2F%2Fwww.facebook.com%2Fconnect%2Flogin_success.html&response_type=token&display=popup&scope=email%2Cuser_about_me%2Cuser_birthday

The page opens fine and I can log in to facebook successfully. However, the option "Keep me logged in to" doesn't work - every time I restart the C# app, I need to type in my password again to login even though I have checked the option in the last login.

The interesting thing is that my email address is always remembered by the facebook login dialog box regardless of whether I have checked the "Keep me logged in" option or not. Hence, facebook is definitely aware who logged in last time but it is not actually keeping the login session.

So can anybody please help advise what is wrong here?

Please not that:

  1. On my facebook app setting, I have made the app public
  2. In the client oauth setting, I have enabled Client OAuth Login/Web OAuth Login/Embedded Browser OAuthn Login
  3. I have added WebSite as the platform, Site URL is http://localhost/
  4. The app has not been submitted for review yet, could it be the problem?

enter image description here

Thanks a lot in advance!

like image 787
Bon Avatar asked Jun 30 '16 12:06

Bon


People also ask

How do I get Facebook to keep me logged in?

If you want to stay signed in to your account, you can use Facebook's auto-login feature. Check the “Remember password” checkbox when you're signing in and you're all set. With this feature, you can click your profile picture from the login screen to directly sign in without having to enter the password.

What is the purpose of keep me logged in?

When you visit most websites, it's common to see a box labeled Keep me logged in, Remember me, or similar next to the username and password fields. If you check this box before you sign in, you won't have to sign back into the website next time you return, even if you close your browser and come back later.


1 Answers

The "keep me logged in" feature is DEFINITELY using a cookie. You might investigate whether the underlying browser technology in the Web View control is configured to save cookies when it's invoked inside of an application, and whether or not you can specifically get it to save cookies. From what I'm reading the control uses Edge.

It makes perfect sense, within the context, to have the default behavior NOT save cookies.

like image 135
Xavier J Avatar answered Oct 20 '22 05:10

Xavier J



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!