Andy Victors
06/14/2019, 1:31 PMinstall(HttpCookies) {
storage = AcceptAllCookiesStorage()
}
on client init?
Specifying this causes iOS MPP to crash, but I need cookies! ;/
P.S. Also I cannot extract it from headers directly 'cause it looks like ktor strips the "Set-Cookie" header before še5l
06/14/2019, 2:24 PMSet-Cookie
header. Can you provide the request sample or log?CookieStorage
interface in place.Andy Victors
06/14/2019, 4:02 PMGET <https://mydomain.com/vpn/lx/index.html>
Since the URL is being the firewall, I get the login-page back, after one redirect (302). Here is the log from doing the same from browser :
Summary
URL: <https://mydomain.com/vpn/lx/index.html>
Status: 200 OK
Source: Network
Address: 87.193.156.22:443
Request
GET /vpn/lx/index.html HTTP/1.1
Cookie: NSC_TASS=aHR0cHM6Ly9sb3MubG94eGVzcy5jb206MTgwODAvbG9zc2VydmljZWFwaS92MS9pbmZvJmNzcmY9ZDIwYzM0MWQ0MTA5MDBjZg%3D%3D
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Host: <http://los.loxxess.com|los.loxxess.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Safari/605.1.15
Accept-Language: en-us
Accept-Encoding: br, gzip, deflate
Connection: keep-alive
Response
HTTP/1.1 200 OK
Content-Type: text/html
Keep-Alive: timeout=15, max=100
Pragma: no-cache
Last-Modified: Tue, 08 Aug 2017 18:00:46 GMT
Content-Encoding: gzip
Expires: 0
Cache-Control: no-cache, no-store, must-revalidate
Date: Tue, 25 Jun 2019 11:47:16 GMT
Content-Length: 1598
Connection: Keep-Alive
ETag: "f94-13ae-55641be1d2f80"
Accept-Ranges: bytes
X-Frame-Options: SAMEORIGIN
ntCoent-Length: 5038
Server: Apache
As you can see, the first response (302/redirect) returned cookie NSC_TASS, which then was used to follow redirect. This all works as expected.
Now when doing the same over Ktor with automatic redirect, I get only the last 200 response, which does not contain any cookie header.
But that means the cookie is lost for me - that's my problem. Assumingly I have to configure the cookie storage, but that's broken now for iOS, right?storage = AcceptAllCookiesStorage()
?