You can clone with
HTTPS or Subversion.
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
I'm having the exactly same problem.
(You can try it here: 188.8.131.52: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?
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.
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.
Same issue here. I thought perhaps I needed to enable $config['enable_query_strings'] = TRUE; but that didn't help.
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.
@golevel I have done the same thing. And it works great.
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.
@mastacheata Does your Library have any advantages over the workflow that Danny Herran suggests?
@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.
@mastacheata It sounds nice, I don't see it on GitHub, do you have it somewhere else?
It's in my personal fork of elliot's codeigniter-facebook:
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.
@golevel's pointer works indeed. Too bad elliot's is broken still...
All you really have to do is grab the original facebook php sdk and replace the native session with a codeigniter session...
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.
@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.