McLaren 3 Posting Whiz in Training

Hi,

I am trying to integrate facebook using library from this blog:

http://www.key2market.com/2010/12/integrating-facebook-with-codeigniter-2-0/

I made a test function:

function index()
	{
		
	       $this->ci =& get_instance();
	     // Create our Application instance
	     	
	 //(replace this with your appId and secret).
	 $this->ci->load->file(APPPATH.'/third_party/facebook.php');
	 
	 $this->data['facebook'] = new Facebook(array(
		 'appId'  => $this->ci->config->item('id'),
		 'secret' => $this->ci->config->item('key'),
		 'cookie' => TRUE,
	 ));
	 
	 $this->data['session'] = $this->data['facebook']->getSession();
	        
	// 	Session based API call.
		 if ($this->data['session']) {
		 echo 'session';  //this is not echoed
		 try {
		 $this->data['fb_user'] = $this->data['facebook']->getUser();
		 print_r( $this->data['fb_user']);
		 return TRUE;
		 } catch (FacebookApiException $e){
		 echo 'error';
		 error_log($e);
		 }
		 }
	        
	}

I am logged in to facebook and run this function. And the line

if ($this->data['session'])

does not return TRUE so I cannot get my facebook name. Any idea why is that?