Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get the "Refused to set unsafe header "cookie"" error when I try from flutter web #88

Open
mikeybellissimo opened this issue Oct 22, 2022 · 2 comments
Labels
question Further information is requested

Comments

@mikeybellissimo
Copy link

Hi!

When I am using Flutter built on chrome and try to send a post request to my Express server to sign in, the cookie is not stored and the console reads the error : Refused to set unsafe header "cookie".

Here is the code that calls from the server side:

final response = await Requests.post("http://localhost:3000/signin",
json: {"username": username, "password": password},
withCredentials: true);

response.raiseForStatus();

  • OS: Windows 10 Home
  • Chrome Version 106.0.5249.119
@sehnryr
Copy link
Collaborator

sehnryr commented Oct 24, 2022

Hi @mikeybellissimo, on web when an http request is done, it's the browser that handles the cookie. The error you get from the console shouldn't be an issue, it's just dart trying to set the cookie by itself though it's actually the browser that does that.

Is response.raiseForStatus(); stopping the app ?

@sehnryr sehnryr added the question Further information is requested label Oct 26, 2022
@loczippo
Copy link

loczippo commented Sep 12, 2024

i have same isue. @mikeybellissimo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants