ASWebAuthenticationSession doesn't share localStorage and cookies with Safari

I'm testing ASWebAuthenticationSession with a site that has a counter increased each time the page loads and saved to localStorage to make sure ASWebAuthenticationSession share data with the site.

The result was that ASWebAuthenticationSession in app and Safari don't share localStorage, even the app presents a pop-up to allow sharing data between the app and localhost (the site is localhost)

I then test with cookie (expires in 1 day), it didn't get share, either.

This is opposite to the behavior documented.

Device: iPhone 11 Simulator, iOS 14.5
IDE: XCode 12.5 on macOS Big Sur - Macbook Pro M1


ASWebAuthenticationSession doesn't share localStorage and cookies with Safari
 
 
Q