Updated cookie received in XHR response’s Set-Cookie header, is not getting supplied into sub-sequent requests.
When updated cookie is being received in XHR (AJAX) Set-Cookie response header, its value is not getting updated in the existing cookie. The next request always uses the stale cookie due to that facing issues with SSO login.
Steps to reproduce:
1. Create a Cordova app using WKWebView
2. Launch the app with HTML page which executes the HTTP request and sends a set-cookie in response header with cookie as “MyCookie=test1”
3. Upon completion of HTTP request, redirect at URL which executes the XHR request and send the updated cookie as “MyCookie=test2” in response header. Note that- cookie received in earlier request is not getting supplied with the XHR redirected request
4. Again execute another XHR request, note that- No cookie is getting supplied with XHR request (Neither Stale nor updated cookie)
Expected Outcome: The cookie received in Set-Cookie header must be supplied with the sub-sequent each type of requests.
• Cookie domain is same (No cross domain)
• Cookie is HTTP Only and Secure
User-Agent : Mozilla/5.0 (iPhone; CPU iPhone OS 14_4_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 (4395668016)
iOS version : iOS 14.4.2