#Issue with receiving set-cookie header on Android

20 messages · Page 1 of 1 (latest)

lofty sorrel
#

Hello. I understand this topic might be well-discussed already, but I haven’t found a clear answer for my situation. Since the early versions of Tauri, I’ve been using the HTTP plugin to work around third-party cookie limitations. It allowed me to retrieve all necessary headers via rawHeaders, so I could then insert session keys into other requests. However, in the current version 2 of Tauri, this capability seems to be missing. I’ve tried every possible key, flag, and other workaround to extract the required session headers, but with no luck.

One workaround might be to create a custom fetch-like command, but everything used to work just fine through the plugin. Experienced specialists, any advice? I’d really prefer not to have to rework the whole system to use tokens and other methods to avoid session cookies.

quiet hull
#

do you still know which plugin version worked?

#

Also, which cargo features for the plugin did you enable, if any? (did you disable its default features?)

#

At first i thought about the unsafe-headers flag but that seems to only matter for headers you set for the request

#

maybe the cookies feature consumes the set-cookie headers though

lofty sorrel
#

In Cargo.toml, I specified:

tauri-plugin-http = { version = "2", features = ["unsafe-headers"] }

I also tried:

tauri-plugin-http = { version = "2", features = ["unsafe-headers", "cookies"] }
#

At some point, the headers are still being filtered, and I don’t receive them as I did in the older versions of Tauri.

#

tauri-plugin-http v2.0.3

quiet hull
#

can you try this? ```toml
tauri-plugin-http = { version = "2", features = ["unsafe-headers", "rustls-tls", "http2", "charset", "macos-system-configuration"], default-features = false }

#

this would be the version without the cookies feature (since it's a default one)

lofty sorrel
#

Bro! That’s genius! Which specific trick enabled the things I needed? Now I'm getting the headers I need. Even getSetCookie is working!

#

I see. Does setting default-features = false and listing other necessary features disable the cookies feature, which filters the headers?

quiet hull
#

And yes, i assume the cookies feature "steals" the cookie headers

lofty sorrel
#

Do I need to open an issue on GitHub? It doesn’t seem like a bug per se; I just didn’t realize I needed to disable the cookies feature, thinking it would actually add cookies for me, not filter them. 🙂 My issue is resolved.

quiet hull
#

i mean idk, it's a bit of a weird behavior. i doubt we can fix it though so you don't have to create one

lofty sorrel
#

I can create it with the solution included, since when I was searching, I didn’t find anything similar. It might help someone else.

quiet hull
#

sounds good :)

lofty sorrel