How to copy cookies in Google Chrome?

Google ChromeCookies

Google Chrome Problem Overview


Is there any way I can copy/edit the cookies in Chrome Developer tools? Or do I need to install a custom add-on for this?

Google Chrome Solutions


Solution 1 - Google Chrome

I think I have found something. I can press Ctrl+A and Drag & Drop the values in a TextBox and then copy it from there.

As pointed by @jmccure,

Ctrl+A, hold Shift and right click and copy.

Update: Chrome 58 added a support to edit cookies

Solution 2 - Google Chrome

Cross-browser Solution:

  1. Hit F12 or Right-click page and Inspect to open the Developer Tools
  2. Click the Application Tab (which used to be called Resources)
  3. Open Cookies on the left, select your site/domain
  4. Double-click cookie column Value
  5. CTRL/Command + C or Right-click and select Copy

Solution 3 - Google Chrome

If you have a lot of cookies and you don't want to install any plugin, I created a small script to avoid copying the cookies one by one.

It was tested only in Google Chrome.

// Open the console in the developer tools

// Tab where you are getting the cookies from
// This block can be just copy and paste

let cookies = document.cookie;
cookies = cookies.split(";");
cookies = cookies.map(cookie => cookie.replace(" ", ""));
copy(cookies);

// Tab where you want to have the cookies
// This block cannot be copy and paste since there is no function to paste

const newCookies = // paste your cookies array here
newCookies.map(newCookie => {
    document.cookie = newCookie;
})

Solution 4 - Google Chrome

An alternative approach to copy a long cookie value:

  1. Repeat the request with the Network tab open.
  2. Right-click the relevant request (in the list on the left-hand side).
  3. Choose Copy as cURL.
  4. Extract the cookie from the generated Cookie header option.

For example: curl 'http://...' -H 'Cookie: session=...' ...

Solution 5 - Google Chrome

This sounds strange, but if you hold Shift and right click, it seems to work most of the time.

Solution 6 - Google Chrome

I use the Edit this Cookie extension for Google Chrome, which is very nice.

According to its documentation:

> EditThisCookie is a cookie manager. You can add, delete, edit, search, > protect and block cookies!

Solution 7 - Google Chrome

You have to select the value and then you can copy it. Double click helps, but if there are some delimiter characters (e.g. ".", "-" etc.) then you have to triple click it (at least in Windows 10).

So basically:

  1. select the value (double or triple click)
  2. copy the selection (Ctrl+C or "Copy" from context menu)

Solution 8 - Google Chrome

Unfortunately, there doesn't seem to be any reliable way to do this from developer tools. Right clicking the value and choosing copy sometimes works, but not if there are delimeter characters.

One workaround is to go into the js console and print document.cookie. Unfortunately, that only works for non HTTP_Only cookies.

Solution 9 - Google Chrome

Another combination that works: Click on cookie value. While holding the left mouse button, click right button thrice. The Copy command will now appear in the shortcut menu.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionImran Qadir Baksh - BalochView Question on Stackoverflow
Solution 1 - Google ChromeImran Qadir Baksh - BalochView Answer on Stackoverflow
Solution 2 - Google ChromegdibbleView Answer on Stackoverflow
Solution 3 - Google ChromeMateo GuzmánView Answer on Stackoverflow
Solution 4 - Google ChromepenfoldView Answer on Stackoverflow
Solution 5 - Google ChromejmccureView Answer on Stackoverflow
Solution 6 - Google ChromeTouqeer ShafiView Answer on Stackoverflow
Solution 7 - Google ChromeallanallanView Answer on Stackoverflow
Solution 8 - Google ChromeAntimonyView Answer on Stackoverflow
Solution 9 - Google ChromealdsView Answer on Stackoverflow