Webprogrammierung Webdesign und Social Media Südtirol
Webprogrammierung Webdesign und Social Media Südtirol Alles über Web 2.0 und Webdesign, Ajax, XHTML, Javascript, CSS und PHP/MySQL.

Artikel-Schlagworte: „javascript client“

Facebooks neues JavaScript SDK: Cookies verifizieren

24. Februar 2010 in Php / Mysql | 1 Kommentar »

<?php

// by Patrick Puecher

$apikey = ''; // Your API key
$secret = ''; // Your application's secret

$cookie = $_COOKIE['fbs_' . $apikey];
$cookie = trim($cookie, '\"');
parse_str($cookie, $parsed);

if($parsed['expires'] > time() || $parsed['expires'] == 0)
{
  $cookie = preg_replace('/&sig=[^&]+/i', '', $cookie);
  $cookie = preg_replace('/&+/i', '', $cookie);
  $cookie.= $secret;

  if(md5($cookie) == $parsed['sig'])
  {
    // verified
  }
}

?>

RSS Feed

Suche

Letzte Kommentare

  • Probleme mit Umlauten - php.de: [...] vielleich hilft dir das hier weiter ! http://www.puecher.com/php-utf-8-cheatsheet/115/ [...]
  • Patrick Puecher: Hallo Adi, selbstverständlich, ihr habt Post. Patrick
  • Adi: Hallo Patrick, kanns du Axel eine Kopie der Links senden, bin heute schwer zu erreichen Danke
  • Patrick Puecher: Hallo Adi, ich habe dir soeben die beiden Plugins gemailt. mfg Patrick
  • Adi: Hi, I just made a paypal donation to the EventList Plugin Phocagallery … now how do I download it?