Cookie Table

Problem

What’s the schema for the cookie table?

Solution

The cookie table holds all of the browser cookies that your app has dropped. Its fields are listed in Table 8-3. There’s no way to use this table to access cookies that other apps or Facebook might have dropped, so your queries will only return results for your app. More information about this table, including an up-to-date listing of fields, can be found at http://wiki.developers.facebook.com/index.php/Cookies_(FQL).

Table 8-3. cookie table fields

Name

Type

Index

Description

uid

int

uid (user ID) associated with this cookie. This is the ID of the user who was using your application when the cookie was dropped.

name

string

 

Name of the cookie.

value

string

 

Value of the cookie.

expires

int

 

Expiry timestamp for the cookie. The cookie never expires if this is empty.

path

string

 

Path relative to your app’s callback URL with which the cookie is associated (i.e., if your app’s callback is http://www.someserver.com/myapp/ and the path is friends/add.php, then it was dropped by the page http://www.someserver.com/myapp/friends/add.php).

Note that only the field marked as “Index” in this table can be used in an FQL query’s WHERE clause, but any of the fields can appear in the SELECT.

Discussion

If you’d rather use the API to access cookies, try the Data.getCookies() and Data.setCookie() methods.

Get Facebook Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.