What's new in Safari and WebKit

RSS for tag

Discuss the WWDC22 Session What's new in Safari and WebKit

Posts under wwdc2022-10048 tag

2 Posts

Post

Replies

Boosts

Views

Activity

iOS 16 set and get cookie failure in WKHTTPCookieStore
Hi, I am not able to set and retrieve cookies from WKWebsiteDataStore when running the following test. The getCookies in the below code always comes empty. I dont understand its failing because it is unable to set the cookie or the get is failing to retrieve cookies. Here is the code: let cookieStorage = WKWebsiteDataStore.nonPersistent().httpCookieStore let properties: [HTTPCookiePropertyKey: Any] = [       .domain: "abc.com",       .path: "/",       .name: "name",       .value: "value",       .secure: "TRUE"     ] let cookie = HTTPCookie(properties: properties)! let cookies = [cookie] let cookieExpectation = self.expectation(description: "cookieExpectation")       cookieStorage.setCookie(cookies[0]) {     cookieStorage.getAllCookies { getCookies in      let mappedCookies = Dictionary(uniqueKeysWithValues: cookies.map { ($0.name, $0.value ) })      let mappedGetCookies = Dictionary(uniqueKeysWithValues: getCookies.map { ($0.name, $0.value ) })      XCTAssertEqual(mappedCookies, mappedGetCookies) cookieExpectation.fulfill()   } } This is failing on iOS 16 simulator. For iOS 15 simulator and mac Catalyst the test case succeeds without any problem. Checked this on xcode 14 release and xcode 14.1 Beta 2
0
1
1.2k
Sep ’22
iOS 16 Safari crashes
Whenever you have to create a password the Safari crashes and you have to either force close multiple times or hard reset.
Replies
1
Boosts
0
Views
1.1k
Activity
Oct ’22
iOS 16 set and get cookie failure in WKHTTPCookieStore
Hi, I am not able to set and retrieve cookies from WKWebsiteDataStore when running the following test. The getCookies in the below code always comes empty. I dont understand its failing because it is unable to set the cookie or the get is failing to retrieve cookies. Here is the code: let cookieStorage = WKWebsiteDataStore.nonPersistent().httpCookieStore let properties: [HTTPCookiePropertyKey: Any] = [       .domain: "abc.com",       .path: "/",       .name: "name",       .value: "value",       .secure: "TRUE"     ] let cookie = HTTPCookie(properties: properties)! let cookies = [cookie] let cookieExpectation = self.expectation(description: "cookieExpectation")       cookieStorage.setCookie(cookies[0]) {     cookieStorage.getAllCookies { getCookies in      let mappedCookies = Dictionary(uniqueKeysWithValues: cookies.map { ($0.name, $0.value ) })      let mappedGetCookies = Dictionary(uniqueKeysWithValues: getCookies.map { ($0.name, $0.value ) })      XCTAssertEqual(mappedCookies, mappedGetCookies) cookieExpectation.fulfill()   } } This is failing on iOS 16 simulator. For iOS 15 simulator and mac Catalyst the test case succeeds without any problem. Checked this on xcode 14 release and xcode 14.1 Beta 2
Replies
0
Boosts
1
Views
1.2k
Activity
Sep ’22