Пример #1
0
 /**
  * Parses the metadata cookie that our Javascript API set
  *
  * @return array
  */
 protected function getMetadataCookie()
 {
     $cookieName = $this->config->getMetadataCookieName();
     // The cookie value can be wrapped in "-characters so remove them
     if (!($cookieValue = trim($this->httpRequest->getCookie($cookieName), '"'))) {
         return array();
     }
     parse_str($cookieValue, $metadata);
     array_walk($metadata, function (&$value, &$key) {
         $value = urldecode($value);
         $key = urldecode($key);
     });
     return $metadata;
 }
Пример #2
0
 /**
  * @param \Nette\Http\Session $session
  * @param Configuration $config
  */
 public function __construct(Nette\Http\Session $session, Configuration $config)
 {
     $this->session = $session->getSection('Facebook/' . $config->getApplicationAccessToken());
 }