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

171
Visualizações
Why is there no csrftoken cookie on Google Chrome and yes on Firefox? - Javascript

I use a Google Chrome extension that injects code on a site but the 'csrftoken' cookie is required to make operations and requests to the site's Api.

In the javascript file i have:

getCookie('csrftoken');

function getCookie(name) {
    const value = `; ${document.cookie}`;
    const parts = value.split(`; ${name}=`);
    if (parts.length === 2) return parts.pop().split(';').shift();
}

The strange thing is that on google chrome these are the visible cookies:

e2sid=c8l1nddg569yvkxj62iiarlp4r08ufo1; i18next=en-US; _fbp=fb.1.1631121679916.782384057; cookielaw_accepted=1; _lr_uf_-qrlpn5=44189bc6-e54a-49fc-a7ff-68386e3565cc; _lr_tabs_-qrlpn5/e2={"sessionID":0,"recordingID":"4-b10b7425-dadc-4581-9428-49408113de74","lastActivity":1631301023256}; _lr_hb_-qrlpn5/e2={"heartbeat":1631301143709}

There is no csrftoken!

But with mozilla firefox is there!

_fbp=hb.1.1615420435388.698735244; csrftoken=P39hGH18QvTbbnbXPQJjvohtsP9rfhWdvym8QFseO2SXhtQk0pRGzIZzsG8R0v4k; cookielaw_accepted=1; i18next=en-US; _lr_tabs_-qrlpn5%2Fe2={%22sessionID%22:0%2C%22recordingID%22:%224-7285fc28-3e2e-4aeb-8868-cb145c375554%22%2C%22lastActivity%22:1631298849357}; _lr_hb_-qrlpn5%2Fe2={%22heartbeat%22:1631298969837}; sessionid=khhmla44khba2hnpkofrljmxblchj6qe; e22sid=kc45umlov487r62zy1qnk5ijglkro1wc; e2sid=wbbcsnxsuffeed2boykowjez9ic24oqh; _lr_uf_-qrlpn5=9524b7b1-4161-4695-9649-ed16ed97fa93

How is it possible ? the link is the same but I can't understand why .... the strange thing is that until a few days ago the 'csrftoken' cookie was also present on google chrome and in fact the extension worked perfectly. The site developers have made an update but I don't understand how this could have caused the deletion of the cookie. Is there anything I can do ?

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