You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extend manageCookies from issue 1649 for web apps #1692
Suggestion: extend manageCookies from issue #1649 for web apps to the following behaviour:
When manageCookies is true, include withCredentials = true when making API requests.
I've checked the proposed fix (withCredentials=true) by modifying http package source to make
bool withCredentials = true;
and it does solve the issue. Browser stores the cookie, it appears in requests to the API.
hi @TheNoumanDev Ivan found an important issue with handling cookies from different domains that we should resolve. The http flutter package we use does not support it. So we either use a different package or enhance it a bit to support it.
expose a property withCredentials (default: false) in our API definition. Read that (if set) to set the value of withCredentials
expose an environment variable allowCrossDomainCookies. when set to true, it will automatically set withCredentials to true for all API calls. That way user doesn't have to remember to set it everytime.
Activity
v-krupsky commentedon Oct 15, 2024
I've checked the proposed fix (withCredentials=true) by modifying http package source to make
bool withCredentials = true;
and it does solve the issue. Browser stores the cookie, it appears in requests to the API.
kmahmood74 commentedon Oct 15, 2024
hi @TheNoumanDev Ivan found an important issue with handling cookies from different domains that we should resolve. The
httpflutter package we use does not support it. So we either use a different package or enhance it a bit to support it.Here's a long discussion on this and a neat solution someone provided
We basically need to do two things -
withCredentials(default: false) in ourAPIdefinition. Read that (if set) to set the value ofwithCredentialsallowCrossDomainCookies. when set to true, it will automatically setwithCredentialsto true for all API calls. That way user doesn't have to remember to set it everytime.