Data.getCookies

From Facebook Developers Wiki

Jump to: navigation, search

Contents

[edit] Description

This method returns all cookies for a given user and application.

Cookies only apply to Web applications; they do not apply to desktop applications.

This method does not require a session key.


[edit] Parameters

RequiredNameTypeDescription
required uid int The user from whom to get the cookies.
optional name string The name of the cookie. If not specified, all the cookies for the given user get returned.


[edit] Example Return XML

<?xml version="1.0" encoding="UTF-8"?> <data_getCookie_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd"> <uid>508508326</uid> <name>Foo</name> <value>Bar</value> <expires>0</expires> <path>/tmp/</path> </data_getCookie_response>


[edit] Response

Returns the data corresponding to the cookie(s) associated with the application for the specified user.


[edit] FQL Equivalent

This function is similar to doing the following FQL query, with the appropriate parameters filled in:

SELECT uid, name, value, expires, path FROM cookies WHERE uid=508508326 AND name='Foo'


[edit] Error Codes

CodeDescription
1 An unknown error occurred. Please resubmit the request.
2 The service is not available at this time.
4 The application has reached the maximum number of requests allowed. More requests are allowed once the time window has completed.
5 The request came from a remote address not allowed by this application.
101 The API key submitted is not associated with any known application.
104 Incorrect signature.


[edit] See Also

Navigation