Bug 228321 - Updated cookie received in XHR response’s Set-Cookie header, is not getting supplied into sub-sequent requests
Summary: Updated cookie received in XHR response’s Set-Cookie header, is not getting s...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: iPhone / iPad iOS 14
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-07-27 05:42 PDT by Rahul Jain
Modified: 2021-08-03 05:43 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rahul Jain 2021-07-27 05:42:17 PDT
Issue Summary: 

Updated cookie received in XHR response’s Set-Cookie header, is not getting supplied into sub-sequent requests.

Description:

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 Information:

•	Cookie domain is same (No cross domain)
•	Cookie is HTTP Only and Secure 

Device details:

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
Comment 1 Radar WebKit Bug Importer 2021-08-03 05:43:17 PDT
<rdar://problem/81457154>