How do I transfer / copy cookies from one browser to another or same browser from one machine to another?

Solution 1:

In Opera browser: Tools->Advanced->Cookies...

In Google Chrome browser:

Install Extension: https://chrome.google.com/webstore/detail/fngmhnnpilhplaeedifhccceomclgfbg and then you can add, delete, and edit your cookies.

To hand over cookies from one browser to another you most likely will have to copy-paste cookie's properties.

Solution 2:

When using Google Chrome, Cookie Editor extension allows you to backup all cookies from one machine and import into a different one.

The process may not appear to be very straightforward the first time, but still fairly quick and easy:

  1. Search for the cookies you want to export
  2. Highlight, and click the middle icon, Add Cookies to the Encrypted Storage
  3. The first time you use the Encrypted Storage, you'll have to enter a password
  4. Repeat steps 1-2 for all the cookies you want to move to the new computer
  5. When finished, go to Encrypted Storage (menu on the left), and Backup. It'll create a cookies.db file on your computer
  6. Transfer the file, and just reverse the steps on the destination computer

Now you have your cookies on a new computer.

If you're exporting from Chrome to use on wget or curl, you can use the great Cookies.txt Export.

Solution 3:

If you are using Internet Explorer use the Import/Export funtion in the File Menu. Other Browsers have similar functions, check the help files.

How to import cookies in IE of computer A to IE of computer B

  • In computer A start up IE.
  • Click on File...Import and Export...
  • In the Wizard window click on Next. Highlight Export Cookies. click on Next.
  • Click on Export to a file.
  • In the window below you can accept the default location of the file
  • cookies.txt or choose your own location using Browse.
  • Now copy that cookies.txt file USB minidrive (whatever).
  • Put the USB minidrive in computer B.
  • Either copy cookies.txt to computer B hard drive or just leave it on the minidrive.
  • In computer B start up IE. Click on File...Import and Export....in the Wizard window
  • click on Next. Highlight Import Cookies. Click on Next.
  • Click on Import from a file. In the window below use Browse to find the cookies.txt file minidrive or on your hard drive if you copied it there. Highlight it. Click on Next.
  • Click on Finish.

Resource from here

Solution 4:

If you're willing to edit some JavaScript code, you can manually import cookies into Chrome with a custom extension, using the chrome.cookies.set() API.

Since you specify the cookie data manually, this lets you import from any source into Chrome. (I used it to transfer cookies from Safari to Chrome.)

  1. Create a folder for your extension. Add a file named manifest.json with the following contents, and edit to specify which site's cookies you want to change (the extension need to be given permission on those sites):

    {
        "name": "CookieImport",
        "version": "0.0.0",
        "permissions": [
            "cookies",
            "*://*.the-site-whose-cookies-you-want-to-change.com/*"
        ],
        "options_page": "options.html",
        "manifest_version": 2
    }
    
  2. Add a file named options.html with the following. This simply loads the script we're going to create below.

    <!doctype html>
    <html>
      <head></head>
      <body>
        <script src="options.js"></script>
      </body>
    </html>
    
  3. Finally create options.js with this code, and edit the beginning of this script to include the cookies you want to import:

    const allCookies = [
        {
            url: "https://www.example.com",
            name: "__foo",
            value: "bar",
            domain: ".example.com",
            expirationDate: Date.parse("8/19/2021, 8:16:03 PM"),
            // see all possible fields at:
            // https://developer.chrome.com/extensions/cookies#method-set
        },
        // ... more cookies here
    ];
    
    const button = document.createElement("button");
    button.type = "button";
    document.body.appendChild(button);
    button.textContent = "Import Cookies";
    button.addEventListener("click", () => {
        for (const c of allCookies) {
            chrome.cookies.set(c, (res) => {
                console.log("set", c, res || chrome.runtime.lastError);
            });
        }
    });
    
  4. Install the extension via the Load Unpacked button as explained in this tutorial: https://developer.chrome.com/extensions/getstarted#manifest

  5. Click the extension's icon and select Options to open the page we created.
    extension menu

  6. Finally, click the "Import Cookies" button to run the script.

Solution 5:

For browser to browser, if you're using Firefox/IE you can use IE Tab Plus, this will seamlessly transfer cookies to IE when launched with the add-on.