Facebook Connect - Up & Running w/ session issues - Elliots Library |
[eluser]anndr0id[/eluser]
Hey! I'm hoping someone on here has used this library and has come up with a solution to this already. I've got this set up and working great - http://www.haughin.com/code/facebook/ However I'm having issues with sessions. Even when I log the user out via facebook, the user variable is still holding on to info like name, pic, and email so when a site user logs out and logs back in as a different facebook user, its getting the wrong user information. Theres a statement in the library: Code: elseif ( $user !== FALSE && $this->user_id === NULL ) Does anyone have any insight or clues on this? Thanks!
[eluser]anndr0id[/eluser]
Fixed it! For those of you looking in the future, I just changed the above code to: Code: elseif ($user !== FALSE && $this->user_id === NULL) { and created a "logout" timeout in javascript to fix the facebook-rest-session error: Code: setTimeout("FB.Connect.logoutAndRedirect('index.php/logout/')", 300000); and everything seems to be running smoothly.
[eluser]nealumney[/eluser]
I've been trying to locate a library (or something) which helps with CI. Where can I get 'Elliots Library' if that is what helps with facebook? Is there any documentation on how it works? Thanks, Neal
[eluser]CSeydel[/eluser]
Hi, just want to submit a small fix for Elliots Facebook-Connect library, so that, if a user never logs out on my application but logs out in Facebook itself the session invalid error could be avoided: Code: <?php
[eluser]JanDoToDo[/eluser]
With this addition I get an error that clear cookie state is not a valid method in Facebook ?!?
[eluser]CSeydel[/eluser]
I am using facebook.php and facebookapi_php5_restlib.php that can be found here: http://wiki.developers.facebook.com/index.php/PHP or for direct download: http://pearhub.org/get/facebook-0.1.0.tgz
[eluser]JanDoToDo[/eluser]
Cheers. Got that. I had to change the conditions in manage_session to : $this->user_id !== FALSE instead of $this->user_id !== NULL everytime it occurred as it is set to "FALSE" by default, which doesnt equate to "NULL" and so it never actually triggered the false condition. Has this not happened to you?
[eluser]CSeydel[/eluser]
after several tries, the error never occured at my application. possible states at my app are: 1. user never logged it, app shows connect button, user connects an generates a new session 2. user returns to app with valide facebook session, app notice it via get_loggedin_user() 3. user returns to app with invalide facebook session, app kills old cookie via clear_cookie_state() and the connect button appears again
[eluser]JanDoToDo[/eluser]
I have another problem - If the user is logged into facebook and goes through the connect procedure its fine However, if the user is not logged into facebook, when the click the fb connect icon they get a "enter your username & password" but when they submit then, it processes the login (as they are now logged into fb) but the popup box then refreshes and displays "page cannot be found" Any ideas? As I said, if they are already logged into facebook it works fine, but if they are not currently logged in it doesnt work! |
Welcome Guest, Not a member yet? Register Sign In |