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

Session randomly dropped? #1

Open
adambossy opened this issue Jan 26, 2010 · 1 comment
Open

Session randomly dropped? #1

adambossy opened this issue Jan 26, 2010 · 1 comment

Comments

@adambossy
Copy link

Ryan,

Thanks for sharing your code for django/facebook connect integration. I am having a slight issue with authentication. I am using the views code to handle authentication that Michael Trosen posted in his slideshow:

http://www.slideshare.net/mrtrosen/lab305-django-facebook-connect-integration-example

I am passing a USER_LOGGED_IN variable to my templates which contains the user.is_authenticated variable.

My scenario is straightforward. I have a page that loads the facebook tags and uses {% show_facebook_button %}. On this page, I click on the Facebook Connect button to log in, which opens the Facebook Connect window. I enter my credentials, click the submit button, the window closes and I am returned to my own site. There is a momentary delay during which my page communicates with Facebook, and then I am logged in.

Once I am logged in it, it looks like everything is working properly. The problem occurs if I navigate away and navigate back to that page. I am logged out when I return to my page. It's quite annoying as it forces me to re-login. I would assume that the package has built in cookies to remember sessions. Any advice on what the problem is or how I can fix this?

Thanks, Adam

@ryanmark
Copy link
Owner

You should start with setting up logging in settings.py - the app uses python logging. By default messages get logged to the console, but you will need to set logging to show debug messages. You should be able to see where you log in and where you're getting logged out.

If you've followed the readme, you should have django.contrib.sessions in your installed_apps. This is what tracks your authentication. It puts a cookie on your client. Make sure the xd_receiver.htm is being statically served, per the instructions. Make sure you're facebook app is setup correctly and you're typing in the domain exactly how it is saved in facebook (127.0.0.1:8000 is NOT the same as localhost:8000).

With that said, there are a few potential points of failure and facebook can be super flaky and will drop your sessions. It just shouldn't do it often. Let me know what you find in the logs, and if any of these quick checks helped.

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