ASWebAuthenticationSession cookies and Safari

Hi! I'm trying to implement ASWebAuthenticationSession to log in to my app via the web app backend. However, I'm a bit confused about the cookies that this has access to. When I set prefersEphemeralWebBrowserSession=false it does not seem to use the cookies from Safari. Or at least, I'm logged into my web app in Safari, but when I use ASWebAuthenticationSession I still have to log in again. Does it not share session cookies with Safari?

I did notice that if I don't use an ephemeral session, once I log out and try to log back in my app does automatically log me in but that's actually unhelpful in my opinion because now I have no way to clear that session because it only lives in the ASWebAuthenticationSession context. If that's the case I may as well use the ephemeral session then because it seems to have only drawbacks.

Ah, it seems to me that on my physical device, ASWebAuthenticationSession does seem to share cookies with Safari. But this doesn't work in the Simulator (Xcode 26/iOS 26 simulator). Is this expected? Thanks!

ASWebAuthenticationSession cookies and Safari
 
 
Q