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.

ST3
  • 785

3 Answers3

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.

ST3
  • 785
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.

Arjan
  • 31,511
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.

gronostaj
  • 58,482