I am make an api call using React, and I want to set a Cookie,this is how I am setting the Cookie
frappe.local.cookie_manager.set_cookie(“key”, cookie_value)
but getting below mentioned error, local-dev.com is site name
Access to fetch at ‘http://local-dev.com:8000/api/method/signin’ from origin ‘http://localhost:8080’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.
I already mentioned allow_cors in site_config.json, when set_cookie() is commented everything is working fine. but getting above CORS error when trying to set cookie.
So I am trying to set Access-Control-Allow-Origin and Access-Control-Allow-Credentials but no use
frappe.response[“Access-Control-Allow-Origin”] = “http://localhost:8080”
frappe.response[“Access-Control-Allow-Credentials”] = “true”
how can i solve this?