Not able to retrive cookie in request.headers in cloudflare worker script, able to retrieve all other headers than cookie

we want to retrive cookie from event.request.headers , when we inspect it using developer tools, cookie is present in request headers, but not able to retreive same using cloudflare worker script.
Able to retrive all other headers other than cookie using same worker script.
code for reference - Object.fromEntries(event.request.headers)

@pavankumar93035 i think we should update here what we did so that in future if someone tries to setup the same thing or face this kind of issue he or she shouldn’t spend more time debugging it.

1 Like

@pavankumar93035 @rasikmhetre may i know how you guys fixed this

@karthik1 in the event object which gets passed through cloudflare worker we can retrieve the cookie in this manner

async function handle(event) {
let cookie = Object.fromEntries(event.request.headers)[“cookie”];
console.log(“Cookie”, cookie);
}