Go Back   Web Scribble Forums » Joomla » jConnector
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-27-2010, 01:54 PM
Junior Member
 
Join Date: Feb 2010
Posts: 5
Lightbulb Fix for: Session key invalid or no longer valid

I have seen a lot of posts asking about white pages (you probably just have error reporting disabled in php config) and invalid session errors.

This is actually a known-problem from the Facebook team:
Common error messages - Facebook Developer Wiki

I had this working and then all of a sudden, something was going nuts, the problem here is that with all the cross-site madness, the Cookies get messed up, following their advice, I modified:

Code:
<yousite>/modules/mod_jconnector/facebook/php/facebook.php
@Line 148 and commented out the els statement,

and now logins seems to magically work. I will try a few more test cases (I am currently logged in to facebook already, need to try logged in and out a few times to confirm and will report if this does not solve).

I think cookies would make it run a little quicker, but if they want less calls to their server, they should figure out a better fix.
__________________
My Joomla Apps: http://www.webdesignhero.com/store
My Joomla Tutorials: http://ericgoldman.name/web-development/4-joomla
Reply With Quote
  #2 (permalink)  
Old 02-27-2010, 01:59 PM
Junior Member
 
Join Date: Feb 2010
Posts: 5
Default adds authtoken

So, I have been playing with it a little bit now - it adds an auth token to every URL and seems to take the page much much longer to load as well, which is not desirable.
__________________
My Joomla Apps: http://www.webdesignhero.com/store
My Joomla Tutorials: http://ericgoldman.name/web-development/4-joomla
Reply With Quote
  #3 (permalink)  
Old 02-27-2010, 02:40 PM
Junior Member
 
Join Date: Feb 2010
Posts: 5
Default

Found this: Facebook Platform Developer Forum / got "?auth_token=somekey&auth_token=somekey&auth_token =somekey..."

Trying his advice, and getting valid values with:

Code:
public function require_login() {
	/**Added by Eric: 2:18 PM Saturday, February 27, 2010
	why? http://forum.developers.facebook.com/viewtopic.php?pid=196832#p196832
	**/
	$this->api_key                 = $api_key;
    $this->secret                  = $secret;
	$fb = new Facebook($api_key, $secret);
	$s = $this->do_get_session($_GET['auth_token']);
	$fb->set_user($s['uid'], $s['session_key'], $s['expires'], $s['secret']);
  
  
  
    if ($user = $this->get_loggedin_user()) {
      return $user;
    }
    $this->redirect($this->get_login_url(self::current_url(), $this->in_frame()));
  }
But this just throws the user to log in again to Facebook, and does not bring them to your site, maybe there is someone who understands what he is telling us to do better and can make the fix, still commenting out the stuff from the first post because when its in, it throws that error.
__________________
My Joomla Apps: http://www.webdesignhero.com/store
My Joomla Tutorials: http://ericgoldman.name/web-development/4-joomla
Reply With Quote
  #4 (permalink)  
Old 02-27-2010, 02:45 PM
Junior Member
 
Join Date: Feb 2010
Posts: 5
Default

One last update for now, it seems at some point during this debugging I added

Code:
$facebook->require_login();
@Line 49 in mod_jconnector.php which seems to have been adding the auth token, at least for now it seems to work without the cookie, without adding the token to the url and logging them in... hopefully its actually doing everything right for now, so the top post should work for most people. Sorry for all the posting as I troubleshoot, but it may be helpful for other people as well
__________________
My Joomla Apps: http://www.webdesignhero.com/store
My Joomla Tutorials: http://ericgoldman.name/web-development/4-joomla
Reply With Quote
  #5 (permalink)  
Old 02-27-2010, 02:46 PM
Junior Member
 
Join Date: Feb 2010
Posts: 5
Default

or maybe not,
@mod can you enable post editing, I feel like a jerk posting a new threat each time.
__________________
My Joomla Apps: http://www.webdesignhero.com/store
My Joomla Tutorials: http://ericgoldman.name/web-development/4-joomla
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 11:14 AM.