Shopify / mobile-buy-sdk-ios

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using Apple Pay or their credit card.
MIT License
453 stars 198 forks source link

Issue in Webcheckout #1187

Open ArohiMagotra opened 1 year ago

ArohiMagotra commented 1 year ago

Hi, I am using web checkout in my application.

The issue if i logout from the application and login again with some other user it is still maintaining session of my previous logged in user.

https://user-images.githubusercontent.com/47588773/197335178-05a98810-fbb4-4c7f-b8b5-e33d50dd0607.mp4

TheiOSDude commented 1 year ago

Upon logout, consider clearing your WK cookies

func clearPersistedCookies() {
        HTTPCookieStorage.shared.removeCookies(since: Date.distantPast)

        WKWebsiteDataStore.default().fetchDataRecords(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes()) { records in
            records.forEach { record in
                WKWebsiteDataStore.default().removeData(ofTypes: record.dataTypes, for: [record], completionHandler: {})
            }
        }
    }
TheiOSDude commented 1 year ago

@ArohiMagotra ^ :)