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 ?