Search results for

ASWebAuthenticationSession cookie

1,295 results found

Post

Replies

Boosts

Views

Activity

WKWebView adding cookie does not work with iOS 18 beta
If you create a cookie and add to the WKWebViewConfiguration the completionHandler returns 'Cookies synced' suggesting cookie was added with success. However, upon inspection of app in Safari the cookie is not there. This is broken in iOS 18 beta and works in previous versions without issue. Did Apple change the WKWebView API and break this feature? code snippet: NSDictionary* settings = self.commandDelegate.settings; WKWebViewConfiguration* configuration = [self createConfigurationFromSettings:settings]; configuration.userContentController = userContentController; NSMutableDictionary *cookieProperties = [NSMutableDictionary dictionary]; [cookieProperties setObject:@foo forKey:NSHTTPCookieName]; [cookieProperties setObject:@bar forKey:NSHTTPCookieValue]; [cookieProperties setObject:@mydomain.com forKey:NSHTTPCookieDomain]; [cookieProperties setObject:@mydomain.com forKey:NSHTTPCookieOriginURL]; [cookieProperties setObject:@/ forKey:NSHTTPCookiePath]; NSHTTPCookie *cookie
9
0
3.8k
Oct ’24
WKWebView default SameSite value for cookies is different in iOS18
In iOS18, WKWebView's default cookie SameSite value is Lax. Prior to iOS18, the default value is None. Is this intentional, or a bug? This change is not documented anywhere. I made a sample XCode project (ViewController code below) to show this change. It loads www.apple.com into a WKWebView and prints cookies. That site has several cookies, but it only explicitly sets SameSite to None for one cookie, s_vi. Every other cookie relies on default WKWebView behavior. When looking at cookies, either in the console or in Safari's Web Inspector, the SameSite value differs. If older than iOS18, every cookie has SameSite of None. If iOS18, all cookies except s_vi have SameSIte of Lax. I also tried manually setting the following cookies: testCookie-none with SameSite set to None testCookie-lax with SameSite set to Lax testCookie-strict with SameSite set to Strict testCookie- with SameSite set to an empty string When looking at these cookies
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
1.9k
Oct ’24
Unable to manually or programmatically create cookie with SameSite=None on iPadOS 18 beta
Unable to create a cookie using WebKit API or manually create a cookie in Safari with SameSite=None on a device using iPadOS 18 beta. In Safari, the None option is still in the drop down as a selection for SameSite which leads me to believe this is a bug. Is this going to be fixed in the release version of iOS 18?
2
0
1.1k
Sep ’24
Reply to WKWebView adding cookie does not work with iOS 18 beta
Is the cookie not there, or is it there but with the wrong SameSite value? It seems in iOS18, the default SameSite value is now Lax instead of None if the server doesn't set it. I opened another forum post about it here https://developer.apple.com/forums/thread/765199 and contacted Apple support. Hoping Apple will have a workaround, as I cannot change what the server does (Salesforce in my case).
Topic: Safari & Web SubTopic: General Tags:
Oct ’24
Cookies problem in iOS beta 18
I have a hybrid mobile app which loads web server screens in its iframe(which is under the WKWebView); an https request is initiated from the mobile app to the web server which returns the html page to be loaded in the iframe. The calls which are initiated from outside the iframe have cookies maintained in their requests, while the ones initiated from inside the iframe(web server page) loose the cookies and do not inherit them in IOS beta 18 while It worked fine in the previous IOS versions. Anybody has infos about this or similar cases?
5
0
2.5k
Oct ’24
Reply to Cookies problem in iOS beta 18
As @Rikardt pointed out, this could be an issue with Apple changing the default cookie SameSite. I created another post about it here with a sample app: https://developer.apple.com/forums/thread/765199 Hoping Apple will have a workaround, as I cannot change what the server does (Salesforce in my case).
Topic: Safari & Web SubTopic: General Tags:
Oct ’24
Reply to Cookies problem in iOS beta 18
@jkhkhbjhbj In the Cordova context we got the Cookies to move in both IOS 18.0 and IOS 18.1. IOS 18.0 being more complex. We basically had to manually inject the cookies from the NS to the WK store. This worked in 18.1 but in 18.0 we have had to one more step to launch the InAppBrowser plugin with a dummy URL to the server (Hidden Call). This then made the cookies available in the IFrame as well. !Important : You could also be hitting issues with the Cookie SameSite where when not passed from server will default to Lax not None like it did before. This can cause issues in an iframe as well as it does not send Lax on post requests. We fixed this by making sure None was set from the server side ( can't do this locally).
Topic: Safari & Web SubTopic: General Tags:
Oct ’24
Game Can't Open (Cookie Run Kingdom)
Recently started playing this game, when I restarted my computer once it glitched out and when I tried to open it again, it said last time you opened this app, it was force quit. Do you want to reopen it? then the app closes itself immediately. How can I fix this? How can I remove the caches?
2
0
2.5k
Jun ’24
iOS 18 HTML images are not loading in WKWebView
iOS 18 WKWebView images are not loading, no errors in older versions. The example while loading HTML is as follows. A problem occurs when you pull an image from a url. To get a URL image you need a cookie or something. I add them too, but it doesn't work on iOS 18. I get the error An error occurred trying to load the resource. and a blue question mark on the screen. webView.configuration.websiteDataStore.httpCookieStore.setCookie(cookie) Resim Görüntüleme
2
0
2.5k
Sep ’24
Reply to iOS 18 HTML images are not loading in WKWebView
Yes, I have identified the issue. Normally, when loading this image URL with URLRequest, there is no problem, and cookies are set when loaded in the WebView. However, my problem occurs here: webView.loadHTMLString(htmlString, baseURL: baseURL) If you leave the baseURL part as nil, the cookies are not recognized, and the images could not be loaded in iOS 18. If you set your default domain URL in the baseURL part, the issue is resolved because the WebView sets the cookies to the baseURL and loads the HTML from there. Thank you.
Topic: Safari & Web SubTopic: General Tags:
Sep ’24
Reply to How to get Password AutoFill to work with ASWebAuthenticationSession?
I'm working also with ASWebAuthenticationSession, and prefersEphemeralWebBrowserSession does not affect to show or not the promp to save the password. Basically, as @ArcadianZ said, ASWebAuthenticationSession is not able to show the save password Alert/prompt asking the user to save the user/password in Passwords App. I'm trying to think why and maybe it's because the save prompt happens on the URL after when it's entered, and in this case it's a redirect to an app URL?
Topic: App & System Services SubTopic: Core OS Tags:
Sep ’24
Reply to ASWebAuthenticationSession issue on iOS 18 simulator
Not really, there are tons of 3rd parties out there that require to exclude arm64 simulator support. I have the exact same issue for a few days now and the problem occurs with ASWebAuthenticationSession and also with SFAuthenticationSession. It wasn't an issue in XCode 15.4, but it's an issue in XCode 16. I dug in the code of one such framework and as soon as you call start on those sessions, they get stuck like in the image above. We cannot update all the 3rd parties to support arm64 sims, nor is this an official requirement. Basically this kills all Intel based macs, which don't even have arm64.
Sep ’24
Reply to SFSafariViewController not loading web pages on Xcode 16 Simulator with iOS 18
I have the same problem. I was using SFAuthenticationSession and updated to ASWebAuthenticationSession, but still the same issue. What I've found: M1 Max + M1 Pro Mac + Xcode 16 + iOS 18 Simulator: App freezes M1 Max + M1 Pro Mac + Xcode 16 + iOS 17 Simulator: no issue Intel Mac + Xcode 16 + iOS 18 Simulator: no issue I will start testing it with the Xcode 16.1 beta
Topic: Safari & Web SubTopic: General Tags:
Sep ’24