Re: Session handling for http clients

Jan Wielemaker <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 08/04/2013 03:30 PM, Torbjörn Lager wrote:
> I'm trying to make two or more http request in a row to a
> session-enabled Prolog web api from a client implemented by means of
> http_open/3. Roghly like so:
> 
>   ...
>   http_open('http://domain.org/first', Stream1, []),
>   ...
>   http_open('http://domain.org/second', Stream2, []),
>   ...
> 
> The thing is that I need the two request to be part of the same http
> session. Just making the requests doesn't ensure that they are. How
> can I solve this?

I _think_ all you need to do is load library(http/http_cookie).  There
are some options there for more advanced cookie processing, but the
default might do find.

	Cheers --- Jan

> 
> Cliopatria has a file sesame_client.pl that seems to do what I want,
> but there's a lot of code there and it got me lost. :-(
> 
> Thanks,
> Torbjörn
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.