Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments misleading for routine 'get_user_from_cookie' #63

Closed
collinsethans opened this issue Jan 5, 2013 · 4 comments
Closed

Comments misleading for routine 'get_user_from_cookie' #63

collinsethans opened this issue Jan 5, 2013 · 4 comments

Comments

@collinsethans
Copy link

From the server side when you use the graph API for access_token, you get it irrespective of the fact whether the user is logged in or not.

Given this, the 3rd paragraph of this routine which mentions of returning a dict with uid and access_token only if the user is logged in is not right.

Correcting this will help new comers (like me) who read the code before adopting it.

Best,
Ethan

@martey
Copy link
Member

martey commented Jan 5, 2013

I am not sure that I understand this.

If you are using server-side authentication, you should not be using get_user_from_cookie because that authentication method does not use cookies. Server-side apps should use get_access_token_from_code instead.

Let me know if I am missing something here.

@collinsethans
Copy link
Author

I was probably not clear. I am using client-side auth and I meant the associated processing on the server side to get the access_token from the cookie.

@martey
Copy link
Member

martey commented Jan 6, 2013

That clarifies things, but I still do not understand this issue.

The "fbsr" cookie is created and deleted by the JavaScript SDK. If the user has not authenticated with Facebook, the cookie will not exist, and get_user_from_cookie should return None. There should not be a situation where the "fbsr" cookie exists without the user having authenticated.

It would help if you could provide steps that explain how to reproduce this issue.

@collinsethans
Copy link
Author

I think I am at wrong here. I was mentioning about the call for getting the access_token in lieu of the code. A couple of days back when I was manually testing the exchange process from a python shell, I had a test case where I log out before I call the get_access_token_from_code and that had worked. Today I tested it extensively and notice that it does not. Mostly I was doing something wrong previously to get the exchange done even when I was logged out, or probably fb was doing something wrong then.

So, effectively, there is no problem with the comment of get_user_from_cookie as I had mentioned initially. Sorry for the dead notice.

@martey martey closed this as completed Jan 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants