Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

247
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda