Chrome 在哪里储存 cookie?

假设我使用 PHP中的 setcookie()函数设置 cookie:

setcookie('name','foo',false,'/',false);

我能看出来:

chrome://settings/cookies

但是,我找不到存储在硬盘上的实际文件。有人能告诉我这个特定的 cookie 存储在硬盘的哪里吗?

261675 次浏览

Since the expiration time is zero (the third argument, the first false) the cookie is a session cookie, which will expire when the current session ends. (See the setcookie reference).

Therefore it doesn't need to be saved.

The answer is due to the fact that Google Chrome uses an SQLite file to save cookies. It resides under:

C:\Users\<your_username>\AppData\Local\Google\Chrome\User Data\Default\

inside Cookies file. (which is an SQLite database file)

So it's not a file stored on hard drive but a row in an SQLite database file which can be read by a third party program such as: SQLite Database Browser

EDIT: Thanks to @Chexpir, it is also good to know that the values are stored encrypted.

On Windows the path is:

C:\Users\<current_user>\AppData\Local\Google\Chrome\User Data\<Profile 1>\Cookies(Type:File)

Chrome doesn't store each cookies in separate text file. It stores all of the cookies together in a single file in the profile folder. That file is not readable.

For Google chrome Version 56.0.2924.87 (Latest Release) cookies are found inside profile1 folder.

If you browse that you can find variety of information.

There is a separate file called "Cookies". Also the Cache folder is inside this folder.

Path : C:\Users\user_name\AppData\Local\Google\Chrome\User Data\Profile 1

Remember to replace user_name.

For Version 61.0.3163.100
Path : C:\Users\user_name\AppData\Local\Google\Chrome\User Data\Default

Inside this folder there is Cookies file and Cache folder.

You can find a solution on SuperUser :


Chrome cookies folder in Windows 7:-


C:\Users\your_username\AppData\Local\Google\Chrome\User Data\Default\
You'll need a program like SQLite Database Browser to read it.


For Mac OS X, the file is located at :-
~/Library/Application Support/Google/Chrome/Default/Cookies

Actually the current browsing path to the Chrome cookies in the address bar is: chrome://settings/content/cookies

Chromium on Linux: it's an SQLite3 database, located at:

~/.config/chromium/Default/Cookies

Google Chrome is going to be similar, try replace with

For Google chrome Version 97.0.4692.71 (Latest Release) cookies are found inside the Network folder.

There is a file called "Cookies".

Path : C:\Users\user_name\AppData\Local\Google\Chrome\User Data\Default\Network

Remember to replace user_name.