Data.setCookie
From Facebook Developers Wiki
Contents |
[edit] Description
This method sets a cookie for a given user and application.
You can set cookies for Web applications only; you cannot set cookies for desktop applications.
This method does not require a session key.
[edit] Parameters
| Required | Name | Type | Description | |
| required | uid | int | The user for whom this cookie needs to be set. | |
|---|---|---|---|---|
| name | string | Name of the cookie. | ||
| value | string | Value of the cookie. | ||
| optional | expires | int | Time stamp when the cookie should expire. If not specified, the cookie expires after 24 hours. (The time stamp can be longer than 24 hours.) | |
| path | string | Path relative to the application's callback URL, with which the cookie should be associated. (default value is /) |
[edit] Example Return XML
| <?xml version="1.0" encoding="UTF-8"?> <data_setCookie_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">1</data_setCookie_response> |
[edit] Response
Returns 1 indicating success or 0 indicating failure.
[edit] Error Codes
| Code | Description | |
| 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. |
