manually create facebook cookie using curl
$250-750 USD
Paiement à la livraison
Hi there,
I have created a facebook connect app. Problem is, the session data is placed in the URL. For security reasons, I cant have this happen.
instead, i need to create a web proxy where I take the users user name and password via a form, and then, when they press submit, use curl to log them into facebook, and write the session information to a cookie that facebook understands.
Then, after successful login, my app will redirect them to my canvas url.
What I need to do is ensure, that facebook will read the cookies I just stored, and keep the user logged in.
Please let me know if you can do this -
For reference, here are a few urls to get you started:
1) The following URL may help with writing cookies, but I am not sure [url removed, login to view]
2) Reading cookies:
define('FACEBOOK_APP_ID', 'your application id');
define('FACEBOOK_SECRET', 'your application secret');
function get_facebook_cookie($app_id, $application_secret) {
$args = array();
parse_str(trim($_COOKIE['fbs_' . $app_id], '\\"'), $args);
ksort($args);
$payload = '';
foreach ($args as $key => $value) {
if ($key != 'sig') {
$payload .= $key . '=' . $value;
}
}
if (md5($payload . $application_secret) != $args['sig']) {
return null;
}
return $args;
}
$cookie = get_facebook_cookie(FACEBOOK_APP_ID, FACEBOOK_SECRET);
Code must be written in PHP
Nº du projet : #816461