Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

245
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda