Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
Error in invocation of cookies.set(object details, optional function callback): Error at parameter 'details': Unexpected property: 'session'

I am trying to set cookies using a chrome extension, to do this, I am fetching data from a URL looping through the data, and setting each as a cookie but I am getting the error: Error in invocation of cookies.set(object details, optional function callback): Error at parameter 'details': Unexpected property: 'session'.. The problem is with hostOnly, session, and id. When I remove them, the error is solved, but I need them so I can't do away with them.

Data Example:

[
{domain: ".example.com"
expirationDate: 1631030158.496085
hostOnly: false
httpOnly: true
id: 1
name: "__cd_bm"
path: "/"
sameSite: "no_restriction"
secure: true
session: false
storeId: "1"
value: "some value
},
{...},
{...},
{...},
{...}
]

How I am doing it(background.js):

fetch("https://somedomain/api/cookies")
            .then((response) => response.json())
            .then((data) => {
              console.log(data)
              for (let kuki of data) {
                chrome.cookies.set({
                  url: kuki.domain,
                  name: kuki.name,
                  value: kuki.value,
                  httpOnly: kuki.httpOnly,
                  path: kuki.path,
                  secure: kuki.secure,
                  storeId: kuki.storeId,
                  sameSite: kuki.sameSite,
                  session:kuki.session,
                  expirationDate:kuki.expirationDate,
                  hostOnly:kuki.hostOnly,
                  id:kuki.id
                  
                });
              }
              console.log("Cookies set successfully!")
            })
            .catch((err) => console.error(err));

Manifest.json permissions:

"permissions": [
    "<all_urls>",
    "webRequest",
    "storage",
    "webRequestBlocking",
    "tabs",
    "activeTab",
    "proxy",
    "cookies",
    "management",
    "http://*/*",
    "https://*/*"
  ],

anyone can figure out the solution, please post

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!