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

Never says logged in. #12

Open
digitalfiz opened this issue Apr 23, 2011 · 15 comments
Open

Never says logged in. #12

digitalfiz opened this issue Apr 23, 2011 · 15 comments

Comments

@digitalfiz
Copy link

I am using the latest codeigniter and latest of codeigniter-facebook and I have my app setup but when I click login it goes to facebook then back to my site and still has the login link. I saw a similair issue but it was centered around a WAMP setup. I am on a LAMP setup. You can test it here: http://dev.digital-focus.us/test/blah/facebook_test I will leave it up and wait for a response

@santiph
Copy link

santiph commented Apr 23, 2011

I'm having the exactly same problem.
(You can try it here: 173.230.130.114:8020/facebook_test) I just download the library .zip.. Unzipped it on CI and configured the config/facebook.php file with my app Id and api secret. But nothing happens. The "Login" message still appears.
What's going on?

@cdevroe
Copy link

cdevroe commented Apr 28, 2011

I'm also having this issue. Facebook recognizes that I'm logged in (since it shows that the app is "connected") but the Facebook Library never returns for this: !$this->facebook->logged_in()

I'm also having the exact same issue with @elliothaughin 's Twitter Library for CodeIgniter and since he hasn't supported the Libraries at all I've had to resort to getting Twitter involved. It turns out both of these Libraries are using an older OAuth spec. Once we get the Twitter Library issue resolved I'll try to focus some time on getting this Library up-to-date as well.

@RyanPaiva56
Copy link

Also having this issue. It always says "login" even though my FB info is showing. I'm on a LAMP stack with everything up to date.

@ChrisTeso
Copy link

Same issue here. I thought perhaps I needed to enable $config['enable_query_strings'] = TRUE; but that didn't help.

@RyanPaiva56
Copy link

Use this guide instead: http://www.dannyherran.com/2011/02/facebook-php-sdk-and-codeigniter-for-basic-user-authentication/

There's really no reason to use Elliot's package anymore. That guide takes all of 5 mins and works perfectly.

@cdevroe
Copy link

cdevroe commented May 9, 2011

@GoLevel I have done the same thing. And it works great.

@mastacheata
Copy link

I'm using codeigniter for a facebook app and not only for sign on. Additionally I wanted to have my stuff consistent and use the resources provided by codeIgniter,.
So I just started from scratch with just the Facebook Authentication guide and the OAuth2.0 spec and wrote a new library.
Too bad Facebook is about the only social network yet running OAuth2.0.

@cdevroe
Copy link

cdevroe commented May 15, 2011

@mastacheata Does your Library have any advantages over the workflow that Danny Herran suggests?

@mastacheata
Copy link

@cdevroe The facebook php sdk handles sessions seperately from codeigniter and makes use of the PHP superglobals, but from what the Codeigniter Documentation says the framework might unset those variables under certain conditions to make you access them via builtin codeigniter functions only.
My library uses the codeigniter sessions and cookies, it's written with using codeigniter provided functions if possible (for example for error handling I use codeigniter's functions to control wether to log or display an error based on level setting in config)
The other advantage is that it only exposes as little stuff publicly as needed.

If you don't need / want this, you're good to go with Danny Herrons workflow using the facebook provided sdk.

@cdevroe
Copy link

cdevroe commented May 16, 2011

@mastacheata It sounds nice, I don't see it on GitHub, do you have it somewhere else?

@mastacheata
Copy link

It's in my personal fork of elliot's codeigniter-facebook:
mastacheata/codeigniter-facebook@3a207734e6e56d48fd0e

This is however not done yet. It works but I have not implemented the error handling completely. For now it just throws empty FacebookException.
I'll finish it up at some point this week, suggestions, error notifications or just comments are welcome.

@anroots
Copy link

anroots commented Jul 4, 2011

@GoLevel's pointer works indeed. Too bad elliot's is broken still...

@rjsmithii
Copy link

All you really have to do is grab the original facebook php sdk and replace the native session with a codeigniter session...

@sami-mw
Copy link

sami-mw commented Jul 18, 2011

The problem AFAICT is that the token stored in the session (facebookSession) is not saved. So when the user is redirected to the function which called login or elsewhere, the library is reloaded and a new facebookSession object is created.
Does that make sense ? How is the session object supposed to work ?

SOLVED: The problem was that CI used an md5 check to verify the authenticity of the cookie and that was failing (I don't know why).
CI only uses that when cookie encryption is disabled so I enabled it by setting $config['sess_encrypt_cookie'] to TRUE in my config.php file.
Happy hacking

@warrenca
Copy link

@millhacker it works for me! thanks a lot!
but had to click the login link twice, i don't know what's the problem again.

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

10 participants