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 }}
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.
Describe the bug
A clear and concise description of what the bug is.
The project is a Angular/Ionic based. It had the issue with the native IOS not retaining the cookies after authentication to do any subsequent requests. I tried to install the @capacitor-community/http plugin and use the Http to make requests instead of "httpClient" imported from angular. The setCookie() method is not setting the Auth cookie before performing a get/post request.
The below is the screenshot of the Request headers using the angular httpClient (It is having the cookie included in the request header)
The below is the screenshot of the Request headers using the native http plugin (It is missing the cookie in the request header)
I have the same issue @mlynch@IT-MikeS@thomasvidas. setCookie is not working for me as well. Has there been any updates or any other workarounds for the iOS issue? My iOS app doesn't set cookies the first time it opens.
Describe the bug
A clear and concise description of what the bug is.
The project is a Angular/Ionic based. It had the issue with the native IOS not retaining the cookies after authentication to do any subsequent requests. I tried to install the @capacitor-community/http plugin and use the Http to make requests instead of "httpClient" imported from angular. The setCookie() method is not setting the Auth cookie before performing a get/post request.
The below is the screenshot of the Request headers using the angular httpClient (It is having the cookie included in the request header)
The below is the screenshot of the Request headers using the native http plugin (It is missing the cookie in the request header)
CODE SNIPPET:
async get(path, method): Promise<Observable> {
const { Http } = Plugins;
try {
const { Http } = Plugins;
const cookies = await Http.getCookies({
url: this.apiUrl("/cookie"),
});
console.log(cookies);
let retValue = "";
for (let i = 0; i < cookies.value.length; i++) {
retValue = cookies.value[0].value;
}
await Http.setCookie({
url: "http://localhost:8102/",
key: ".ASPXAUTH",
value: retValue,
});
const ret = await Http.request({
method: method,
url: this.apiUrl(path),
headers: {
"X-Fake-Header": "Max was here",
"Content-Type": "application/json",
withCredentials: true,
},
});
console.log("Got ret", ret);
return ret;
} catch (e) {
console.error(e);
}
}
The text was updated successfully, but these errors were encountered: