I am utilizing Django to set HttpOnly and Safe cookies for my React internet utility. These cookies work completely on Chrome (each desktop and cellular) and Android gadgets.
Nonetheless, I am encountering a serious challenge on iOS:
-iOS Safari: Cookies should not continued; they’re handled like session cookies and are deleted when the browser is closed.
-iOS React Native WebView: Much like Safari, the cookies should not continued.
-İOS Chrome: It really works.
-Android React Native WebView: It really works.
MAX_AGE = 60 * 60 * 24 * 360
COMMON = {
"httponly": True,
"safe": True,
"samesite": "None",
"path": "/",
"area": ".myweb.web",
"max_age": MAX_AGE,
}
def set_auth_cookies(response, access_token: str, refresh_token: str):
response.set_cookie("refresh_token", refresh_token, **COMMON)
response.set_cookie("access_token", access_token, **COMMON)
return response
I’ve confirmed that the max_age is about to a protracted period, so it isn’t a session cookie by design. This challenge appears to be particular to the iOS ecosystem.
What might be inflicting this habits on iOS Safari and WebView, and the way can I guarantee these cookies are correctly continued?
{
setLoadedOnce(true);
lastLoadEndAt.present = Date.now();
failCount.present = 0;
if (healthTimer.present) {
clearTimeout(healthTimer.present);
healthTimer.present = null;
}
}}
onContentProcessDidTerminate={() => webRef.present?.reload()}
onRenderProcessGone={() => webRef.present?.reload()}
onShouldStartLoadWithRequest={() => true}
setSupportMultipleWindows={false}
onError={() => setTimeout(() => webRef.present?.reload(), 300)}
renderError={({ description }) => ⚠️ {description} }
onHttpError={(e) =>
console.log("HTTP", e.nativeEvent.statusCode, e.nativeEvent.description)
}
/>
What might be inflicting this habits on iOS Safari and WebView, and the way can I guarantee these cookies are correctly continued?