question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AcceptAllCookiesStorage() in Client JS is not working

See original GitHub issue

Ktor Version

io.ktor:ktor-client-core:1.1.3 io.ktor:ktor-client-js:1.1.3 "io.ktor:ktor-client-json-js:1.1.3

Ktor Engine Used(client or server and name)

Client JS

Feedback

Im Using :

 HttpClient()
            {
                install(JsonFeature) {
                    serializer = KotlinxSerializer(Json.nonstrict)
                }
                install(HttpCookies) {
                    // Will keep an in-memory map with all the cookies from previous requests.
                    storage = AcceptAllCookiesStorage()

                }
            }

Against Vertx server, vertx is returning a session cookie but is not being stored

response headers:

HTTP/1.1 200 OK
access-control-allow-origin: *
content-type: application/json
content-length: 294
set-cookie: vertx-web.session=7c4fa75e69a2f3d8df94efd8f109f1a8; Path=/

is there an extra step?, since you are wrapping fetch api i I noticed it needs to set a parameter:

credentials: 'include'

regards.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
e5lcommented, May 14, 2020

The issue is fixed with cookies refactoring in 1.3

1reaction
Soup-Fliescommented, Jun 17, 2019

I’d like to add that I’m building a multiplatform project and I have the same issue on an Android build on version 1.1.3. It does not regard any received set-cookie headers to store the cookies.

Edit: For more information on the IOS crash… I have found that the crash is related to ktor_mutex_create hitting a bad address, but i’m limited in getting any more information out of it. EXC_BAD_ACCESS (code=1, address=0x8)

Read more comments on GitHub >

github_iconTop Results From Across the Web

`require 'socket.io-client.js'` not working - Stack Overflow
The require() function is a feature of Node.js and only works on the Javascript that is run on the server side. To include...
Read more >
WhatsNew 1.6 | Ktor Framework
JS client seem to ignore `HttpCookies` feature (or header more generally) in browser target, but not in nodejs one.
Read more >
Client Side JavaScript does not run at all
Solved: Hello everyone, I'm looking for some help with client side scripting using javascript. I've been stuck on this for a couple of...
Read more >
@sanity/client - npm
Argument is a plain JS object representing the document. It must contain a _type attribute. It may contain an _id . If an...
Read more >
SMART on FHIR JavaScript Library | SMART JS Client Library
It is not maintained any more, and it would require Jquery to be included in the page. Newer versions of fhir.js work fine,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found