CodeIgniter - My session data is not Facebook?

I am wondering if there is a way to reset all values

$this->session->userdata() 

so that I can troubleshoot?

I work on Facebook and have a login page, and once this is successful, I want to transfer the UID of the current user, and I thought that would work well.

I currently have uid installed:

require_once 'facebook.php';
$appapikey = 'XXXX';
$appsecret = 'XXXX';
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();
$this->db->like('uid', $user_id);
$this->db->from('users');
$has_signed_up = $this->db->count_all_results();

if ($has_signed_up == 0) {
redirect('/setup/signup/', 'location');
}
else {
$this->session->set_userdata('uid', $user_id);
redirect('/preferences/index/', 'location');
}

So, the redirection happens, and I have a very simple setup by settings / index:

    echo "this is the preferences form <br />";
    echo $this->session->userdata('uid');
    echo $this->session->userdata('session_id');

And the result is incomprehensible:

this is the preferences form
858f500e167e359edc1942a96f3bac35

Thus, it completely skips the middle echo containing the uid. I do not install it right? Is there a way to reset all session array values ​​to see what happens? Any help would be great.

UPDATE

I run var_dump ($ this-> session-> userdata) on every raw website and through Facebook.

- , 5 (session_id, IP, User_agent, last_activity uid).

Chrome Chrome 4 , CodeIgniter. , cookie 4k, . FB cookie (: ) ?

2

:

  else {
  $this->session->set_userdata('uid', $user_id);
  echo ':test_'.$this->session->userdata('uid').'_test:';
  //redirect('/preferences/index/', 'location');
  }

: test_1234_test: Facebook. - ( ).

, ? , "" ? , , , Facebook cookie, .

3

, cookie, , FB , .

  • $user_id = 1234
  • $this- > session- > set_userdata ('uid', $user_id)
  • Var_dump

: DB http://nikolausjj.facebook.joyent.us/Picture2.png

, , , . - , CI- , ? "" .

+3
2

var_dump() . -

var_dump($this->session);

set_userdata . , $user_id. , uid .

echo ':test_'.$this->session->userdata('uid').'_test:';

  • ?
  • _ ?
  • CI PHPsessions
  • uid / ?

:

  • redirect('/preferences/index/', 'refresh'); location
  • facebook, /preferences/index ? , ( ) $this->load->library(‘session’) autoload.php.
  • $config[‘sess_match_ip’] `FALSE
  • $config[‘sess_encrypt_cookie’] FALSE
  • CI- CI
  • UID, cookie. , , .
+1

, Facebook. API Facebook UID . , .: -/

0

Source: https://habr.com/ru/post/1720842/


All Articles