Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi

I am trying to preserve connection (shouldn't by default be kept-alive?) to the server so that sessions stays accross different queries I'm sending to the server.

Scenario:
I'm executing
1) one IWEB_GetResponse() to send username and password to the server. Everything works fine, I'm getting back response with acknowledgement that login was successful.
2) second IWEB_GetResponse() sends request to the server to get some data.

I cannot get anything back from the server, since session closed, and I need to log in again (WebResponse header contained Connection: close). Second GetResponse() was successful, and I do get full response back - no error, header contains all valid values, but no data since server doesn't recognize this requestor any more.

Anyone has suggestions on how can I preserve session through two IWEB_GetResponse() calls? Or how to issue two or more queries (HTTP GET) to the server - to the same session (should I specify something in WEBOPT_HEADER of the second GetResponse() call)?

Should something be done on the server?

Thanks a lot for help!
-tpw

I think problem here is with Set-Cookie value that comes from the server. I don't know how to handle this... I'm trying to make a header for the second request that contains that cookie, but cannot make it work...
Thanks for any help / or suggestion...

I think problem here is with Set-Cookie value that comes from the server. I don't know how to handle this... I'm trying to make a header for the second request that contains that cookie, but cannot make it work...
Thanks for any help / or suggestion...

It appears that your server is not honoring the "Connection: Keep-Alive" header.
You could also specify the username/password in each request, as part of the URL: "http://user:pass@host:port/path".

It appears that your server is not honoring the "Connection: Keep-Alive" header.
You could also specify the username/password in each request, as part of the URL: "http://user:pass@host:port/path".

Thanks for the hint on sending username & password with each call.
About my issue - it was more problem with USER_AGENT string, that terminated the HTTP header...

Thanks for the hint on sending username & password with each call.
About my issue - it was more problem with USER_AGENT string, that terminated the HTTP header...