Where to find Facebook cookie?

I'm new to this, so bear with me. I installed the "Sign in with Facebook" button through the Javascript SDK, which works great. I also created the PHP code (facebook.php). I can successfully login to Facebook via javascript, but then I can not access the UID from the session via php. So, how can I get php to access javascript session sets? thank

Edit: (the code below is sent to make it easier to read)

I can console log the response and see it.

FB.getLoginStatus(function(response) {
    console.log(response.session.uid);
});

Refresh the page and try to access the session that was installed through php, it is null.

require_once(RELATIVE_PATH.'applibs/facebook.php');
$config = array('appId'=>Config::$fb_app_id, 'secret'=>Config::$fb_secret, 'cookie'=>true);
$fb = new Facebook($config);
$fb->getUser(); // this will equal null because the $fb object isnt finding the cookie supposedly set by javascript

* Was there any kind of debugging in facebook.php

358...   $ cookieName = $this- > getSessionCookieName();
  //retuns fbs_myNumericAppId, , ..
  if (isset ($ _ COOKIE [$ cookieName])) {
  // ! $_COOKIE ['fbs_myNumericAppId']

, facebook.com, , ?
, facebook.com facebook, $_COOKIE. , facebook facebook.com, -, , FB.login . cookie javacript, $_COOKIE, php - .

+3
1

, .

Facebook ""? , . Cookie, Facebook, ( "" ) "" ( - , , ), , ( , ).

cookie , cookie. , , API- Facebook.

+4

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


All Articles