O'Reilly logo

Facebook Cookbook by Jay Goldman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required