[Haskell-cafe] Network.Curl cookie jar madness

Michael Orlitzky michael at orlitzky.com
Sun Aug 19 06:45:47 CEST 2012

On 08/18/2012 08:52 PM, Michael Orlitzky wrote:
> I'm one bug away from a working program and need some help. I wrote a
> little utility that logs into LWN.net, retrieves an article, and creates
> an epub out of it.

I've created two pages where anyone can test this. The first just takes
any username and password via post and sets a session variable. The
second prints "Success." if the session variable is set, and "Failure."
if it isn't. The bash script,



  echo 'Logging in...'
  curl --cookie-jar "${COOKIE_JAR}" \
       --data "${POST_DATA}" \

  echo 'Retrieving second page...'
  curl --cookie "${COOKIE_JAR}" \


  $ ./bash-test.sh
  Logging in...
  Retrieving second page...

The attached haskell program using Network.Curl, doesn't:

  $ runghc haskell-test.hs
  Logged in...

Any help is appreciated =)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: haskell-test.hs
Type: text/x-haskell
Size: 2268 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120819/6604f221/attachment.hs>

More information about the Haskell-Cafe mailing list