How do I view, add or edit Cookies in Google Chrome?

299

88

I wish to view, add and edit the cookies of my google chrome. Can anyone suggest to me a way to do it?

user67024

Posted 2011-02-10T15:06:55.223

Reputation: 3 099

16as the option changed in newer versions of Chrome, just right-click on page and choose Inspect (or press F12), go to Application tab and choose Cookies which is under Storage section: Right-Click: Inspect > Application tab > Storage > Cookies – S.Serpooshan – 2016-11-12T11:16:53.053

Answers

260

You can go to the Developer Tools (Ctrl-Shift-J or Tools -> Developer Tools) -> Console and the you can enter javascript command:

document.cookie="keyofcookie=valueofcookie"

You can replace or add new cookies with this technique.

It is possible to set multiple cookie options, i.e.

document.cookie="username=John Doe; expires=Thu, 18 Dec 2013 12:00:00 UTC; path=/";

StanleyD

Posted 2011-02-10T15:06:55.223

Reputation: 2 736

Hi, can you also set the expiry date using this method? – Drewdavid – 2014-10-08T04:22:20.017

Hi David, I just edited my answer to show how to add expiry and path. – StanleyD – 2014-10-13T11:49:35.050

1Typing in address bar works as well. – kenorb – 2015-09-01T16:57:06.290

You can also press F12 to open the dev tools, which is slightly quicker. – Gnuffo1 – 2015-09-11T09:26:42.740

1@s3m3n If you want to change an HttpOnly cookie without using third party plugins, you can first use the Resources tab to delete the cookie, and then use document.cookie to create a new cookie. – kasperd – 2016-04-05T09:29:30.280

how to open developer tools on a mac? – gurghet – 2016-08-20T21:56:22.523

on Mac use cmd-option-i – John Henckel – 2016-09-16T14:38:09.600

@kenorb not in Chrome version 61 it doesn't - it performs a google search. – Matt – 2017-11-19T23:57:28.980

This also works in Safari – Andrew – 2019-02-22T02:13:15.217

8Stanley basically said it but to clarify - if you only edit a single cookie with this command, it will not delete all the other cookies on the site, it really only replaces the cookies mentioned in the command. – Jon z – 2013-09-11T22:21:03.903

37

This won't work if some website is using HttpOnly flag to prevent access to cookies by JS (to deny XSS attacks). More on wiki.

– s3m3n – 2014-05-06T17:37:15.727

117

Perhaps the easiest way to view your cookies in Chrome is to visit:

  • chrome://settings/cookies

This does not allow you to edit the cookies in Google Chrome 33.0.1750.117 (Official Build 252094) on Mac OS X, but does allow viewing and deleting.


Update (2017-08-08) [verified in 59.0.3071.115 (Official Build) (64-bit)]

In more recent versions, cookies are listed at:

  • chrome://settings/content/cookies

Update (2018-03-01) [Google Chrome 64.0.3282.167 (Official Build) (64-bit)]

To see the content you will need to select "See all cookies and site data" or follow...

  • chrome://settings/siteData

Johnsyweb

Posted 2011-02-10T15:06:55.223

Reputation: 2 324

5There is no hyperlink, because Chrome does not allow hyperlinks for chrome://. – Martin Thoma – 2015-06-07T07:24:47.273

2@moose Although Chrome does permit you to add these special links to Chrome's bookmarks for easy access (it also assigns a special "cog" favicon). I have this particular one on my bookmarks-bar for easy access. – MrWhite – 2015-10-13T12:09:34.633

@w3d It might work from the bookmakrs folder, but not on a webpage. Just try it: https://jsfiddle.net/egrLcmr1/

– Martin Thoma – 2015-10-13T12:28:55.880

2@moose Yes. (Although Chrome used to allow you to drag these special links to the address bar / omni box, but they stopped that as well - you just get the about:blank page now. You can still manually "Copy link address" and paste it in the address bar - marginally quicker than selecting, copy and paste.) – MrWhite – 2015-10-13T12:37:01.727

Well, that depends on your workflow. For me, clicking 3 times fast on the text and pressing CTRL+C is much faster than doing a right-click and selecting "copy link". – Martin Thoma – 2015-10-13T12:43:00.013

1This should be the accepted answer. This is by far the easiest way to do it. – user1751825 – 2016-11-16T06:43:43.550

This method can't work on 59.0.3071.109 version – Daniel YC Lin – 2017-06-23T01:27:40.413

4@Daniel: In Chrome 59, the new address is chrome://settings/content/cookies (You can find it by searching for "Cookies" in the search box at the top of the settings page.) – Ken Bloom – 2017-06-30T13:24:09.437

5The location is changed. New location is chrome://settings/content/cookies?search=cookie – Sm Yamashita – 2017-07-24T07:54:47.090

If you go to chrome://settings/siteData it will bring up the cookies and site data page. – twasbrillig – 2018-02-22T18:12:47.400

This doesn't let you see the content of cookies, at least not any more. – felwithe – 2018-02-26T22:07:15.900

@felwithe updated answer – Johnsyweb – 2018-03-01T03:08:38.503

chrome://settings/siteData?search=cookies – user237209 – 2018-08-05T20:21:11.040

Doesn't show any cookies for websites opened in Incognito mode. – izogfif – 2019-01-15T03:54:49.350

@izogfif try https://superuser.com/a/392638/37904 for incognito mode.

– Johnsyweb – 2019-01-15T08:09:39.673

@Johnsyweb as I wrote in a comment to identical answer: https://superuser.com/a/1354839/120788: It shows only cookies for domains related to the current tab, not all cookies. Very inconvenient when debugging pop-up sign-in windows like "login via Facebook" etc.

– izogfif – 2019-01-15T10:20:03.097

61

Using 10.0.648.45 dev you can view cookies in Options → Under the Hood → Content Settings → All Cookies and site data.

Alternatively, you can view the cookies for the current site with the Developer Tools (F12, Ctrl-Shift-J or Settings (hamburger icon) More Tools → Developer tools), Application → Cookies.

Dan H

Posted 2011-02-10T15:06:55.223

Reputation: 1 978

Note that viewing Resources > Cookies (in developer tools) just shows the cookies that are available to the current request. Whereas "All cookies and site data..." shows you all the cookies that have been set for a particular domain (regardless of the path). – MrWhite – 2015-10-13T12:13:58.903

@phihag And if cookie value too long, Developer Tools will trim it. – HEX – 2016-04-21T10:34:19.330

2Under Application | Cookies in the newer version of Chrome (59), you can edit existing values and add new entries (by double clicking on the last row). – Kenston Choi – 2017-08-04T07:01:17.160

40But you cannot edit the values in either pane, can you? – phihag – 2012-12-16T08:45:44.920

14That's correct, you can only view them in Chrome without addons. – Dan H – 2012-12-27T00:36:06.867

32

I have been frustrated by the current solutions on the extensions store to view, edit, create, remove cookies. The current solutions appeared as popups and did not have a good UI. I wanted to get the same functionality as the firebug cookies editor with a Chrome look and feel. So I made one:

Cookie Inspector - Missing cookie manager for Google Chrome. Edit and create cookies right in the Developer Tools.

westoque

Posted 2011-02-10T15:06:55.223

Reputation: 490

Doesn't work with Chrome 42. Any other? – nitech – 2015-05-27T10:20:10.170

Hi @nitech. I'm on Chrome 43 and it's working pretty well. Maybe you can table what's not working in support. Thanks.

– westoque – 2015-05-28T15:01:49.587

Finally a decent replacement for Firecookie. Thank you man! – georg – 2013-10-07T10:13:48.060

28

For the actual page

Recently it is changed from Resources to Application. So:

  1. Press F12
  2. Go to Application (tab) > Cookies (sidebar)
  3. Edit the existing cookies, or create a new one by double-clicking into an empty row.

Snapshot:

enter image description here

AKT Domains

Posted 2011-02-10T15:06:55.223

Reputation: 281

17

For all pages

  1. Go to Settings:

    enter image description here

    (now you are on chrome://settings/)

  2. Scroll to the Privacy section > Content Settings...

    enter image description here

    (now you are on chrome://settings/content)

  3. Click on All cookies and site data...

    enter image description here

    (now you are on chrome://settings/cookies)

  4. Here you can view/remove cookie or remove all cookies. Click on the labels to see details.

    enter image description here

For the actual page

  1. Press F12
  2. Go to Resources > Cookies

    enter image description here

  3. In the right side you can see the cookies. If you want to delete them > right click > Delete:

    enter image description here


To edit cookies, I recommend the Chrome plugin: EditThisCookie (https://chrome.google.com/webstore/detail/editthiscookie/fngmhnnpilhplaeedifhccceomclgfbg) that was already mentioned.

ROMANIA_engineer

Posted 2011-02-10T15:06:55.223

Reputation: 572

OK, and how to do it in the Incognito mode? chrome://settings is opened in non-Incognito window and It doesn't show me any cookies even though I have tons of tabs opened in the Incognito mode. – izogfif – 2019-01-15T03:54:03.183

Chrome is fine for viewing, and it looks like EditThisCookie gives wrong information and is malware/adware or at best, borderline adware
https://superuser.com/questions/1430151/why-does-chromes-editthiscookie-extension-seem-to-list-some-cookies-as-sess/1430211#1430211

– barlop – 2019-04-26T22:56:26.900

13

There is a Chrome plug-in called Edit This Cookie. It adds a menu to your browser toolbar which allows you to add, edit, and delete cookies.

Install it from here: https://chrome.google.com/webstore/detail/edit-this-cookie/fngmhnnpilhplaeedifhccceomclgfbg

The source code is here: https://github.com/fcapano/Edit-This-Cookie

Christopher Adams

Posted 2011-02-10T15:06:55.223

Reputation: 139

Just installed and seems like a good plugin. Plus it allows you to edit httpOnly cookies. Very handy. – Felix Eve – 2016-06-09T05:42:26.690

Chrome is fine for viewing, and it looks like EditThiscookie gives wrong information https://superuser.com/questions/1430151/why-does-chromes-editthiscookie-extension-seem-to-list-some-cookies-as-sess/1430211#1430211

– barlop – 2019-04-26T22:21:42.880

5

For completeness it should be noted that you don't need the developer tools console or any add-ons, extensions or plug-ins.

The javascript commands provided by @StanleyD can be directly entered into the address bar with just an additional "javascript:" prepended. E.g.

javascript:document.cookie="keyofcookie=valueofcookie"

This is useful in an environment where you need to send a cookie change out to a bunch of non-tech users without overwhelming them with steps.

Non person

Posted 2011-02-10T15:06:55.223

Reputation: 188

3This doesn't work if HttpOnly has been used. – Flimm – 2016-01-13T13:50:52.570

4

I would recommend use external cookies managers. Personally, I like ChromeCookiesView and CookieSpy.

ktapkin

Posted 2011-02-10T15:06:55.223

Reputation: 86

7FYI, CookieSpy is AdWare – Justin Holzer – 2013-04-08T15:19:15.533

2

If you just want to view all the cookies for the current page, without having to click on each one from the GUI, you can do this:

Open the developer console, and print the cookies for the current page by entering this in the console:

> document.cookie

See more at http://www.w3schools.com/js/js_cookies.asp

nealmcb

Posted 2011-02-10T15:06:55.223

Reputation: 496

1

On at least v59 of Google Chrome you can go to:

chrome://settings/content/cookies

despuestambien

Posted 2011-02-10T15:06:55.223

Reputation: 111

1

There is plenty of extensions that can help with that. Here is a less known one that works well that I made. It is called Cookie-Editor.

Cookie-Editor is designed to have a simple to use interface that let you do most standard cookie operations. It is ideal for developing and testing web pages or even manual management of cookies for your privacy.

It let's you view all your cookies and edit or create new cookies. You can also delete your cookie and import/export them to a file.

It fits exactly what you were asking and I find it simpler to use than the built in tool since you can access it directly from the toolbar.

You can download it on the Chrome webstore: https://chrome.google.com/webstore/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm

Moustachauve

Posted 2011-02-10T15:06:55.223

Reputation: 11

0

Reza

Posted 2011-02-10T15:06:55.223

Reputation: 101

this extension gives wrong information https://superuser.com/questions/1430151/why-does-chromes-editthiscookie-extension-seem-to-list-some-cookies-as-sess/1430211#1430211 and may also be adware

– barlop – 2019-04-26T22:24:30.567