Data.getCookies

From Facebook Developer Wiki

Jump to: navigation, search

Contents

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.

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.

Response

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

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>

FQL Equivalent

FQL queries take the form: SELECT <fields> FROM <table> WHERE <conditions>

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'

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.

Notes

  • This method does not require a session_key. Desktop applications should not call this method.
  • You can call this method using a session secret, and not the application secret (for example, for a Facebook Connect site).

See Also

reference