Post

Replies

Boosts

Views

Activity

Reply to Is HTTPCookieStorage.shared.setCookies(_:for:mainDocumentURL:) synchronous or asynchronous?
Hi Team, Thank you for the response. I'd like to share some of my observation regarding the behavior of the setCookies(_:for:mainDocumentURL:) method that we have encountered. We noticed that the cookies we are setting include Max-Age and Expires attributes. While we are able to retrieve these cookies immediately after calling setCookies(_:for:mainDocumentURL:), they do not appear to persist on disk immediately. We believe the system initially stores these cookies in a temporary storage, flushing them to disk only after a delay. We observed this because: If we kill the app immediately after setting the cookie, it is unavailable upon relaunch. If we wait a few seconds (~3–5 seconds) before killing the app, the cookie is successfully retrieved in the next session. We have seen similar asynchronous behavior with UserDefaults.standard in the past. To work around this for our current needs, we shifted our implementation to store these cookies manually in FileManager using data.write(to:options:). While this workaround resolves our immediate issue, we would appreciate any guidance on whether this is expected behavior for setCookies. Is there a recommended way to force a flush to disk, or a best practice to ensure session cookies are persisted reliably before the app is terminated? Thanks
4w
Reply to Is HTTPCookieStorage.shared.setCookies(_:for:mainDocumentURL:) synchronous or asynchronous?
Hi Team, Thank you for the response. I'd like to share some of my observation regarding the behavior of the setCookies(_:for:mainDocumentURL:) method that we have encountered. We noticed that the cookies we are setting include Max-Age and Expires attributes. While we are able to retrieve these cookies immediately after calling setCookies(_:for:mainDocumentURL:), they do not appear to persist on disk immediately. We believe the system initially stores these cookies in a temporary storage, flushing them to disk only after a delay. We observed this because: If we kill the app immediately after setting the cookie, it is unavailable upon relaunch. If we wait a few seconds (~3–5 seconds) before killing the app, the cookie is successfully retrieved in the next session. We have seen similar asynchronous behavior with UserDefaults.standard in the past. To work around this for our current needs, we shifted our implementation to store these cookies manually in FileManager using data.write(to:options:). While this workaround resolves our immediate issue, we would appreciate any guidance on whether this is expected behavior for setCookies. Is there a recommended way to force a flush to disk, or a best practice to ensure session cookies are persisted reliably before the app is terminated? Thanks
Replies
Boosts
Views
Activity
4w
Reply to Delay with AVFoundation Metadata Callbacks
Hi Team, I've raised a similar ticket on Feedback Assistant, please let me know if you require further details from my end. https://feedbackassistant.apple.com/feedback/17766014 Thanks
Topic: Media Technologies SubTopic: Streaming Tags:
Replies
Boosts
Views
Activity
Jun ’25