views:

133

answers:

3

Hi All,

I'm trying to integrate facebook connect on to my website using php sdk.

I have successfully been able to get user data and stuff using connect. However, my session data is coming up in the URL cos the cookie is not been set.

Can someone please let me know as to why this could be happening.

Thanks, Alloi

A: 

Check where the SDK saves the cookie (If the Facebook PHP SDK uses curl, follow the variables) and set permissions 0666 to that folder. (i think that it uses the folder where your running script is, not the Facebook PHP SDK Script)

CuSS
A: 

"Could not set cookie. Headers already sent" is a PHP error message. It occures, when you try to set header()-values (like the cookie), after you already started printing your code.

The cookie needs to be set, before the first echo "".

If this is within the facebook api, your onlychance is to set the cookie via JavaScript:

var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
JochenJung
A: 

I think perhaps I know what may have caused that error. Perhaps alloi did not remember to put the Application ID number and the Application Secret into the external site code.

ImproperUsername