Jonathan
05/17/2023, 1:10 PMAcceptAllCookiesStorage()
as CookiesStorage
on my httpClient.
To remove cookies when logging out from our app, we invalidate all the cookies by updating their expiring date.
Just like this :
fun CookiesStorage.invalidateCookies(url: URL) {
val invalidatedCookies = get(url).map { it.copy(expires = GMTDate(timestamp = -1)) }
invalidatedCookies.forEach { cookie -> addCookie(url, cookie) }
}
It works on Android but not on iOS.
After spending some times on the subject, I noticed that the cookies on the CookiesStorage are always empty.
But when I do the requests on my app, I do have cookies.
I did succeeded to found where the cookies were stored but I couldn't delete or invalidate them.
To sum up :
AcceptAllCookiesStorage().get(url).count()
=> 0 cookies (doesn't work)
httpClient.cookies(url).count()
=> 3 cookies (works but can't update them)
Is this a known problem or did I do something wrong ?Aleksei Tirman [JB]
05/18/2023, 10:15 AM