Joshc
Joshc

Reputation: 3853

Facebook PHP SDK storing session cookie. How can I stop this?

I unfortunately live in the EU and have this horrible cookie legislation.

See below my application instance.

$facebook = new Facebook(array(
    'appId'  => $fb_app_id,
    'secret' => $fb_secret,
    'cookie' => true
)); 

Unfortunately this stores a cookie called... PHPSESSID

How can I prevent this cookie from ever downloading???

I tried this but did not work...

$facebook = new Facebook(array(
    'appId'  => $fb_app_id,
    'secret' => $fb_secret,
    'cookie' => false
)); 


Any help would be amazing thanks.

Upvotes: 1

Views: 1917

Answers (1)

complex857
complex857

Reputation: 20753

You will have to reimplement the Facebook class from the facebook sdk. The meat of the functionality in the Base_Facebook class, and the Facebook one only implements the session persistence (calling session_start() in it's __constructor that creates that cookie).

You will also have to find a new way to make session available for your users. PHP support sessionid passed around in URLs with:

ini_set("session.use_cookies", 0);
ini_set("session.use_trans_sid", 1);

but that isn't really a good idea (non malicious url copy-paste makes it easy to steal sessions).

Upvotes: 2

Related Questions