Hi guys,
I have a problem to get auth cookie from http response. I'm trying to make something like "session driven REST" - at the first attempt, try to connect without HTTP username and pass - it will fail with 401 - NOT AUTHORIZED. Then, try to send request again with user credentials - it shoud be succesful - and there is a Cookie with session ID hidden in response, which should be used instead of HTTP base auth. My cookie set command from headers looks like
Set-Cookie JSESSIONID=A862CD252DB886DE4CA814758755405E; Path=/RAT/; Secure; HttpOnly
This is a trace from httpfox and I can find this cookie on similar android application which has the same feature.
But I cant see this cookie anywhere in my restsharp response, not in
Headers collection, not even in cookie collection, even when HTTP Base authorization succeeded and I am able to deserialise data from content. Shall I do anything
special here?
My HTTP headers:
< HTTP/1.1 401 Unauthorized
< Server: Apache-Coyote/1.1
< Cache-Control: private
< Expires: Thu, 01 Jan 1970 00:00:00 UTC
< Set-Cookie: JSESSIONID=53EF3FE938F894D42203A2803E1A5561; Path=/RAT/; Secure; HttpOnly
< Content-Length: 0
< Date: Wed, 10 Apr 2013 13:41:22 GMT
and if I use HTTP auth:
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Cache-Control: private
< Expires: Thu, 01 Jan 1970 00:00:00 UTC
< Set-Cookie: JSESSIONID=1B56F62207E309813FEC3ACCEC9D74F1; Path=/RAT/; Secure; HttpOnly
< Content-Type: application/xml
< Content-Language: cs-CZ
< Content-Length: 202
< Date: Wed, 10 Apr 2013 13:44:02 GMT
<