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: „cookie“

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

  • Patrick Puecher: Hi, please check your inbox. Cheers, Patrick
  • Muebles LLuesma: Hemos donado 25 €. Nos pueden enviar el modulo por favor? Es muy urgente
  • Patrick Puecher: Ciao Alessandro, ti ho appena mandato il modulo. Prova anche a controllare nella cartella spam. Saluti, Patrick
  • Alessandro: Hi Patrick! I have donated 25 Euro to your account for the module prestashop maximum order quantity for PrestaShop 1.5, but I do not see any link to download the module. Would you send me the module, please? Thanks, Alessandro
  • Patrick Puecher: Hi Pablo, yes it works for 1.4.7.3. Cheers, Patrick