Search results for

ASWebAuthenticationSession cookie

1,295 results found

Post

Replies

Boosts

Views

Activity

Having issues clearing cookies in Safari via NextJS
I have a web application built in NextJS that I use cookies to handle persisting authentication details. I clear the cookies on logout and this works in other browsers. However, when I run this on Safari, it seems the browser is caching the cookie information. When I use the Safari debugger, I do not see the cookies in the Storage view, however, when I use document.cookies, I can retrieve them fine - which should not happen. This is not the case in Chrome. I can't find any information on this online, so any help or insights would be greatly appreciated.
0
0
837
Feb ’24
Reply to WKWebView sometimes lose cookies after the app returns from suspension
Facing similar issue with WKWebkit. After few hours of resuming the app, the cookies are getting cleared automatically. I am using below code - let webConfiguration = WKWebViewConfiguration() webConfiguration.websiteDataStore = WKWebsiteDataStore.default() let contentController = WKUserContentController() webConfiguration.userContentController = contentController webConfiguration.allowsInlineMediaPlayback = true webConfiguration.preferences = preferences webKitView = WKWebView(frame: webContentView.bounds, configuration: webConfiguration) Please suggest what to do ?
Topic: Safari & Web SubTopic: General Tags:
Feb ’24
Safari and Safari Technology Preview completely broken after upgrading from Ventura 13.6.5 to Sonoma‌ 14.4
Hi, three days ago I made the mistake of upgrading to Sonoma 14.4. After the upgrade, I tried to open Safari, and was met with a popup window/prompt asking whether I want to open the window/tabs from the previous session. Regardless of whichever option I chose, Safari just froze completely. I tried force quitting, and starting Safari whilst holding the Shift key (which should open a fresh session), but that also didn't work. Following that, I tried starting Safari in Safe Mode, but that also did not work. I should note that at this time Safari Technology Preview was working fine. After half a day of trying to troubleshoot this, an Apple Mail extension (Mailbutler) prompted me to sign in to my Google account, and that process triggered a small window/session of Safari to open (with the Gmail login page). Finally, I was able to access the Safari menubar settings. I went into the menubar settings, deactivated all 20 or so of my extensions, deleted all website data, deleted cache for both of my two profiles, quit
Topic: Safari & Web SubTopic: General Tags:
0
0
762
Feb ’24
Reply to Intercept WebView requests and add Auth token in all subsequent resource request [GET .js, .png, .css].
Usually in such cases you want to add tokens as a cookie attached to request, in that case you need to save that cookie to WKWebView first and then load page. At this point question is what your server expects? In which way that token must be passed? p.s. Those delegate methods that you mentioned are designed to be invoked only for main resources like HTML pages and iframes so they are useless for sub-requests interception.
Topic: App & System Services SubTopic: Core OS Tags:
Feb ’24
Reply to Services Worker in WKWebView
Hi! Service Workers are not available for WKWebView, except if your app has web browser entitlement. You may try to use regular Workers instead and store data in IndexedDB, LocalStorage or Cookies. Read here about Service Workers in WKWebView: https://forums.developer.apple.com/forums/thread/722160
Topic: Safari & Web SubTopic: General Tags:
Feb ’24
WKWebView sometimes lose cookies after the app returns from suspension
I embedded a WKWebView in my SwiftUI app, and loaded a list of HTTPCookie into a WKWebViewConfiguration object: var wkWebViewConfiguration = WKWebViewConfiguration() let cookies: [HTTPCookie] = ... // logic that creates a list of HTTPCookie for cookie in cookies { wkWebViewConfiguration.websiteDataStore.httpCookieStore.setCookie(cookie) } This logic works but when the app returns to the foreground from a long suspension (more than an hour), sometimes the web view reloads the URL but the cookies are gone. I suspect the web content process is terminated and add a logic to reload the URL and the cookies on process termination: // WKNavigationDelegate method func webViewWebContentProcessDidTerminate(_ webView: WKWebView) { // reload the URL and cookies here } but the issue still persist, could there be any other reasons that the cookies are lost or is my above solution not sufficient to handle web content process termination? This issue is qu
Topic: Safari & Web SubTopic: General Tags:
5
0
4.7k
Feb ’24
Reply to Safari keeps logging me out of websites
I'm getting exactly the same issue since upgrading to Sonoma 14.2.1 on a M1 Mac mini. I observe YouTube constantly logging me out (sometimes within an hour of a login) and also news.bbc.co.uk losing cookies and asking me to accept cookie preferences again. Did you file a bug report ? If so what is the reference number and I will add my views to it.
Topic: Safari & Web SubTopic: General Tags:
Jan ’24
Reply to ASWebAuthenticationSession initiated session, file:// URL is not loaded and "Confirm the file to load" is presented instead
While this doesn't directly answer your question, hopefully it's a better alternative. Starting in iOS 17.4 and macOS 14.4, you can now set additional headers in ASWebAuthenticationSession. https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession/4316246-additionalheaderfields
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’24
Reply to Are PWA App Data and Cookies Cleared When iPad Turned Off for Long Periods
I hope you're doing well. I noticed your post about users being prompted to re-login to the PWA on their iPads after turning them off for extended periods. It's an interesting challenge. I was wondering if you've received any responses or insights from the community regarding this issue. Additionally, have you been able to identify a solution or root cause for the re-login prompt? If there's any further information you can share, it would be helpful. Also, I came across https://www.netguru.com/blog/how-to-share-session-cookie-or-state-between-pwa-in-standalone-mode-and-safari-on-ios with some information related to PWAs and iOS behavior. Have you had a chance to explore this resource? Looking forward to hearing more about your progress.
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’24
Reply to What's the best approach to introduce user authentication for VisionOS
While I'm not familiar with Auth0's API, it sounds like it's a wrapper for ASWebAuthenticationSession. ASWebAuthenticationSession is fully supported on visionOS and is great if you need users to authenticate through a web browser rather than in native UI. If you want your app to really shine, native sign-in within an app always feels better than jumping out to a web browser. For that, ASAuthorizationController is the best experience. The ASAuthorization family of APIs allows you to make a combined request for multiple types of credentials, if you support it. If the only sign in method you support is passwords, it provides a nice native sheet offering any passwords the user has. If you also support other methods like passkeys or Sign in with Apple, you can make a single request with all of those credential types and the system will offer whatever credentials the user currently has. This WWDC session is primarily focused on passkeys, but also goes over several ASAuthorization use cases.
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’24
How to reset the CookieAcceptPolicy setting for NSHTTPCookieStorage.
I made a change to the CookieAcceptPolicy in NSHTTPCookieStorage in my app: [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyNever]; When I use the following code to restore its settings: [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain]; WKWebView still does not store cookies. I found that in iOS 17, the cookie policy for WKWebView can be enabled through the following configuration: [[[WKWebsiteDataStore defaultDataStore] httpCookieStore] setCookiePolicy:WKCookiePolicyAllow completionHandler:^{}]; But how can this be done in versions prior to iOS 17?
Topic: Safari & Web SubTopic: General Tags:
0
0
363
Jan ’24