Where does Chrome store cookies?
Asked Answered
I

9

84

Let's say I set a cookie using the setcookie() function in PHP:

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

I can see it in:

chrome://settings/cookies 

However, I can not find the actual file stored on my hard disk. Can anyone tell me where this specific cookie is stored on the hard disk?

Icebreaker answered 24/6, 2015 at 8:41 Comment(6)
By default, it's a file saved in the path pointed to by the session.save_path setting in your php.iniMenhaden
Do you wonder where the cookie is stored on the server, or in the browser? Because what you see when using chrome://settings/cookies is the cookies in the browser, which have no idea what cookies could possibly be stored in the server.Upon
The cookie is on client side no? so i'm wondering where is it stored on the client side on hard disk @JoachimPileborg. I can see other cookies saved on my hard drive by the websites i visited but i can not find the cookie i just created.Icebreaker
See superuser.com/questions/459426/…. All browsers use similar schemes.Upon
I already looked it up, I can see other cookies created by other websites on my hard drive but the actual cookie that i created by php as explained above seems missing?!!Icebreaker
That's exactly where i get confused, cause i'm using the same machine as server and client (using localhost so my machine plays two roles, server and also client), So if i create a cookie, is the cookie get stored on the hard drive of the machine? (cause it's server and also client) if so where? if not how come that i can it on my browser settings?Icebreaker
I
107

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\Network

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.

Icebreaker answered 24/6, 2015 at 10:3 Comment(10)
It's important to add that the cookie value is stored encrypted.Wayside
Is there any way to view the encrypted Cookies file using SQLite Database Browser?Doughnut
No, through SQListe Database Browser. But you can use Windows Data Protection API (DPAPI) to do so.Paronychia
FYI, in Debian 6 (Squeeze), said Cookie file can be found in ~/.config/chromium/DefaultMilklivered
Windows Data Protection API (DPAPI) is some tool in Windows? If so, can attacker after obtaining file, decrypt it on another computer?Emie
I've downloaded DB Browser (SQLCipher) from sqlitebrowser.org/dl and on startup the app asks for the encryption key. Does anyone know how to find what Chrome uses ? Without the key you can't delete individual cookies, etc.Rosierosily
Deleting cookies file won't clean all cookies. Where are the rest of the cookies?Incandescence
I was able to read my Cookies file stored at the given location using SQLite Browser, which means that Cookies arent encrypted.Norm
They have just been moved to the subfolder \Default\Network\CookiesRoney
The cookies file is now <Chrome user profile directory>\Network\Cookies . See answer by MFKDGAF.Palaeobotany
J
31

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.

Jarred answered 18/1, 2022 at 14:6 Comment(2)
Reference: https://dfir.blog/cookies-database-moving-in-chrome-96/Saire
Note, if the user uses Chrome profiles, then cookies will be stored in C:\Users\<your_username>\AppData\Local\Google\Chrome\User Data\Profile [n]\Network where [n] is the profile number (1,2,3, etc)Invagination
I
7

Windows:

C:\Users\<username>\AppData\Local\Google\Chrome\User Data\<profile>\Network\Cookies

You'll need a program like SQLite Database Browser to read it. However, do not that values are stored with encryption.

macOS:

~/Library/Application Support/Google/Chrome/Default/Cookies
Incommensurate answered 28/12, 2017 at 8:4 Comment(0)
P
3

On Windows the path now is:

C:\Users\<username>\AppData\Local\Google\Chrome\User Data\<profile name>\Network\Cookies

Chrome doesn't store each cookie in a separate text file. It stores all of the cookies together in a single SQLite file called Cookies in the profile folder as mentioned above. The cookies values are also stored in an encrypted manner and thus not directly readable.

Pyramidon answered 4/5, 2016 at 7:21 Comment(0)
D
3

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

Dulcle answered 28/9, 2019 at 22:3 Comment(0)
I
2

For Google chrome Version 56.0.2924.87 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.

Irrigate answered 28/2, 2017 at 16:42 Comment(2)
"Profile 1" is just a profile directory, for each Chrome profile cookies can be found i its profile directory: "Profile 2", "Profile 3", etcFigureground
If you're on windows, you can just use the environment variable %localappdata% instead of "C:\Users\<user_name>\AppData\Local".Dramatics
I
2

In case you came here to find out how to see info about the cookie of a particular website in Chrome, open Inspector (press F12) navigating the website, go to the tab Application/Aplicativo and look below in the left tree, there is Storage/cookies with all info:

  • cookie variables
  • content, length
  • expiration dates, etc
Interoceptor answered 21/12, 2022 at 21:11 Comment(0)
U
0

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.

Upon answered 24/6, 2015 at 9:14 Comment(3)
I tried it with setcookie('name','masoud',time()+3600,'/',false); ,yet i can not find the cookie file on my hard drive!!Icebreaker
@varDumper Did you check the browsers SQLite cookie database? (Follow my Superuser link in a previous comment)Upon
Thanks for your time dude, Yes i checked it. I know where chrome stores the cookies. As i mentioned above i can see all other cookies created by other websites. But the actual cookie that i created by php script seems missing!!Icebreaker
E
0

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

~/.config/chromium/Default/Cookies

Google Chrome is going to be similar, try replace with

Evars answered 26/6, 2021 at 18:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.