I need to get or set cookies for my application.
method to set a cookie (where
is the UID of the user you want to drop the cookie for):
$cookieReturn = $facebook->api_client->data_setCookie($user, 'cookie_type', 'chocolate_chip');
method to get a cookie (where
is the UID of the user you want to retrieve the cookie for):
$cookie = $facebook->api_client->data_getCookies($user, 'cookie_type');
You can specify optional
path settings for cookies when you drop them
(the defaults are 24 hours and
$cookieReturn = $facebook->api_client->data_setCookie($user, 'cookie_type', 'chocolate_chip', '1254079800', '/some/path/here');
Note that the
argument is measured in epoch seconds (see Formatting Relative Time for more information about epoch
If you don’t specify a cookie name for
Data.getCookies(), it will return all of
the available cookies for the specified user.
Cookies in Facebook are handled differently than a regular browser-side cookie dropped by a regular web page. The cookies are actually managed by Platform and are associated with the user’s account rather than residing in her browser, so they’ll be present whenever that user logs into Facebook from any computer. Facebook will pass any unexpired cookies to your application with each request from a Canvas page to your callback URL, and will store any cookies you return (up to a limit of ...