Jump to content

pushkidman

New Members
  • Posts

    4
  • Joined

  • Last visited

pushkidman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Here's the above code. I've tried doing it this way, yet I still don't get data from another session...
  2. if (!$User->getSessionKey()) { $User->setSessionKey(Roller::Session()->getId())->save(); } else { Roller::Session()->restart($User->getSessionKey()); } .... class Roller_Core_Session { public function init() { session_start(); global $_SESSION; if(!isset($_SESSION[$this->_sessionNamespace]) || !is_array($_SESSION[$this->_sessionNamespace])) { $_SESSION[$this->_sessionNamespace] = array(); } } public function restart($id) { session_id($id); $this->init(); } ....
  3. Hey there! I am wondering, is it possible to fetch data from PHP session, that was created in on another browser/computer? Let's say I know session_id() (it's stored in the database). I've googled a lot for that, but could not find any proper answer I've only found one solution, which said, that I had to restart session with new session_id(), but data from another computer is not in the array, when I output it.
  4. Hi! I am trying to put Facebook SDK to work. I had this code, which I slighly modified, from some internet tutorial: <?php $fbconfig['appid'] = "..."; $fbconfig['secret'] = "..."; $fbconfig['baseurl'] = "..."; $user = null; //facebook user uid try { include_once "facebook.php"; } catch (Exception $o) { error_log($o); } // Create our Application instance. $facebook = new Facebook(array( 'appId' => $fbconfig['appid'], 'secret' => $fbconfig['secret'], )); //print $facebook->getAccessToken() . '<br/>'; $user = $facebook->getUser(); $loginUrl = $facebook->getLoginUrl( array( 'scope' => 'email,offline_access,publish_stream,user_birthday,user_location,user_work_history,user_about_me,user_hometown', 'redirect_uri' => $fbconfig['baseurl'] ) ); if ($user) { if (isset($_GET['publish'])) { try { $publishStream = $facebook->api("/$user/feed", 'post', array( 'message' => "...", 'link' => '...', 'picture' => '...', 'name' => 'iPlay, iWin', 'description' => '...' ) ); //as $_GET['publish'] is set so remove it by redirecting user to the base url } catch (FacebookApiException $e) { d($e); } $redirectUrl = $fbconfig['baseurl'] . '?success=1'; header("Location: $redirectUrl"); } //fql query example using legacy method call and passing parameter try { $fql = "select name, hometown_location, sex, pic, pic_square, pic_big from user where uid=" . $user; $param = array( 'method' => 'fql.query', 'query' => $fql, 'callback' => '' ); $fqlResult = $facebook->api($param); print_r($fqlResult); $fql = "select url, real_height from profile_pic where id=" . $user; $param = array( 'method' => 'fql.query', 'query' => $fql, 'callback' => '' ); $fqlResult = $facebook->api($param); } catch (Exception $o) { d($o); } } ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>FB Test</title> </head> <body> <?php if (!$user) { ?> <a href="<?= $loginUrl ?>">Facebook Login</a> <?php } else { ?> <div><a href="<?= $facebook->getLogoutUrl(); ?>">Facebook Logout</a></div> <div>You are in! <a href="?publish=1">Share your details with us</a>!</div> <?php } ?> <?php if ($_GET['success']) : ?> <div>Check you FB wall!</div> <?php endif; ?> </body> </html> There are two troubles I have with this code: 1. When I am logged in with Facebook and I go to this page, I still have to connect to FB manually via $loginUrl. Is this OK in terms of SDK? Or am I doing something wrong? 2. When I click on logout URL, nothing happens on the page. It seems to log me out properly out of my actual FB account, but on the page $user object still exists. Sometimes I have to click logout URL several times, before I actually see changes on the page. Why is that? Thanks in advance for any sort of help!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.