1

I am writing some scanner for Google Chrome cookies, as stored in a SQLite database. It also has an option to delete cookies, however I didn't find any ID field. The most similar is creation_utc, I don't have much info about it, but I found out that it is some kind of timestamp. I would like to know if this value is unique or not.

I need this because while deleting some cookies I use a few fields, and it is not an optimal way to do it. If creation_utc is unique, it would take less time to delete the cookies.

3 Answers 3

1

By design, each combination of domain and path can only have one cookie with a specific name. (If a server sends a new cookie, the old one is replaced.)

So even when the database has another primary key (like you're suggesting in your own answer), I still feel the domain and path should be the real primary key.

1
  • I used this time-stamp converter and found that value in database cannot be converted into time format because is too big. So I think Google Chrome uses some advanced time-stamp and counts milliseconds, it let use this as primary key.
    – ST3
    Aug 26, 2013 at 7:49
1

I have found an answer. I used query: PRAGMA table_info(cookies) it gave result all columns, their types and etc. One of the attributes was called pk (primary key). All columns had set to 0, but creation_utc is set to 1, so it is primary key.

1
  • This is, technically, correct; .schema Cookies tells you the same. Weird.
    – Arjan
    Aug 26, 2013 at 8:09
0

I guess creation_utc = UTC when the cookie was created. So no, it doesn't guarantee uniqueness.

If you just want to delete cookies for a single site, you can use this answer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .