enonic / lib-http-client

Http Client Library for Enonic XP.
Apache License 2.0
0 stars 4 forks source link

Access to cookies #10

Closed Cagilisto closed 5 years ago

Cagilisto commented 6 years ago

It does not seem like cookies are available in the response. Could you add support for cookies?

ComLock commented 5 years ago

ref: https://github.com/enonic/xp/issues/6680

ComLock commented 5 years ago

It looks like the problem is the internal redirect handling that does not handle cookies.

Have a look at http://lvh.no/naar_det_haster/abcde__primaer-_og_sekundaerundersoekelsen/abcde-prinsipper

Here is what chrome does:

Request: lvh.no without any cookies Respond: Set cookie tibet_access on lvh.no and redirect to tibet.gyldendal.no

Request tibet.gyldendal.no with previous tibet_session cookie Respons: Set cookie tibet_session on tibet.gyldendal.no and redirect to lvh.no?redirect_from_tibet=true

Request lvh.no?redirect_from_tibet=true with tibet_access cookie (from step 1) Respond: redirect to lvh.no no set-cookie headers

Request lvh.no with tibet_access cookie (from step 1) Respond 200 with set cookie _legevakt_session (edited)

ComLock commented 5 years ago

ref: https://github.com/enonic/xp/issues/6683