Where does Chrome store cookies?

前端 未结 6 1115
执笔经年
执笔经年 2020-11-29 00:18

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

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

I

相关标签:
6条回答
  • 2020-11-29 00:39

    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.

    0 讨论(0)
  • 2020-11-29 00:41

    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.

    0 讨论(0)
  • 2020-11-29 00:45
    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
    
    0 讨论(0)
  • 2020-11-29 00:49

    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.

    0 讨论(0)
  • 2020-11-29 00:58

    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.

    0 讨论(0)
  • 2020-11-29 00:59

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

    0 讨论(0)
提交回复
热议问题