File tree Expand file tree Collapse file tree
webview-compose/src/wasmJsMain/kotlin/io/github/kdroidfilter/webview/cookie Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11@file:OptIn(ExperimentalWasmJsInterop ::class )
22package io.github.kdroidfilter.webview.cookie
33
4+ import io.github.kdroidfilter.webview.util.KLogger
45import kotlinx.browser.document
56
67/* *
@@ -62,11 +63,12 @@ object WasmJsCookieManager : CookieManager {
6263 }
6364
6465 override suspend fun removeCookies (url : String ) {
65- /* *
66- * In a browser context, we can't easily remove cookies for a specific URL,
67- * So we'll use the same approach as removeAllCookies
68- * Alternative: use CookieStore (https://developer.mozilla.org/en-US/docs/Web/API/CookieStore)
69- */
66+ // Browser document.cookie API does not support removing cookies for a specific URL/domain.
67+ // Falling back to removing all cookies. Consider using CookieStore API for finer control:
68+ // https://developer.mozilla.org/en-US/docs/Web/API/CookieStore
69+ KLogger .w(tag = " WasmJsCookieManager" ) {
70+ " removeCookies(url=$url ): URL-specific cookie removal is not supported in browser context, removing all cookies instead"
71+ }
7072 removeAllCookies()
7173 }
7274}
You can’t perform that action at this time.
0 commit comments