[erlang-questions] iBrowse Cookie Support

Tristan Sloughter tristan.sloughter@REDACTED
Mon Feb 20 01:34:12 CET 2012


Thanks Anthony! Yup, that was my bad, I put it in the 5th argument.

On Sun, Feb 19, 2012 at 5:21 PM, Anthony Molinaro <
anthonym@REDACTED> wrote:

> Hmm, I'm not seeing this.  If I run
>
> % nc -l 8081
>
> in one terminal, then start erl and ibrowse
>
> % erl
> Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:2:2] [rq:2]
> [async-threads:0]
> [hipe] [kernel-poll:false]
>
> Eshell V5.8.5  (abort with ^G)
> 1> application:start(ibrowse).
> 2> ibrowse:send_req ("http://localhost:8081/
> ",[{cookie,"SESSIONID=XXXXXX"}],get).
>
> I see the following in the first terminal
>
> GET / HTTP/1.1
> Cookie: SESSIONID=XXXXXX
> Host: localhost:8081
> Content-Length: 0
>
> Are you attempting to pass [{cookie, "SESSIONID=XXXXXX"}] as the 5th
> argument
> in ibrowse:send_req/5?  Because those options are ibrowse options, not http
> headers.  The headers are the second argument of either form.
>
> HTH,
>
> -Anthony
>
> PS. this was ibrowse 3.0.2 BTW
>
> On Sun, Feb 19, 2012 at 10:33:59AM -0600, Tristan Sloughter wrote:
> > ibrowse seems to be ignoring the cookie I pass to options. In an email to
> > this list from 2009 someone says it does not support cookie management,
> but
> > I take that to mean it simply won't handle storing and passing the
> cookies
> > for you. Instead you must pass {cookie, string()} to send_req in the
> > Options list like:
> >
> > [{cookie,"SESSIONID=XXXXXX"}]
> >
> > But this isn't working, while testing the request with curl and --cookie
> > "SESSIONID=XXXXXX" does.
> >
> > Am I missing something?
> >
> > Thanks,
> > Tristan
>
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-questions
>
>
> --
> ------------------------------------------------------------------------
> Anthony Molinaro                           <anthonym@REDACTED>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120219/61af4c35/attachment.htm>


More information about the erlang-questions mailing list