Cookies-woes

  • Hi,

    I'm having big trouble with NSURLDownload in combination with
    cookies. All works fine on 10.4 but not on 10.5. The idea is as follows:
    - a user tries to access a website through a socalled ezproxy in a
    webview
    - since he is not authenticated for the session he's forwarded to the
    login/password page
    - when he submits the password a cookie is set (at least I can see
    the cookie being derived from the headers of the response)
    - the ezproxy system then forwards me to the website.

    So far so good. And if I try to go to a different link on that page
    it works fine.
    However when I try to use NSURLDownload after that to get a PDF from
    the same domain I am forwarded again to the authentication page.
    Somehow it seems that the download ignores the cookies that have been
    set previously.

    Interestingly I can reproduce the issue in safari. If I navigate on
    the authenticated page and click on a PDF link the PDF will be shown
    fine in Safari. However if I right click on the same link and choose
    "Download linked file" it now downloads the html page where I would
    have to login again.

    Does anyone have a clue what's going on here? What has changed in
    Leopard with respect to how NSURLDownload uses cookies? Or is there
    something else I'm overlooking?
    A workaround would be brilliant.
    Thanks,
    Alex
  • Hi Darin,

    Thanks for looking into this. I've filed a radar bugreport this
    morning, including small demo project: ID# 5612474
    Let me know if you need anything.
    Best wishes,
    Alex

    On 26-nov-2007, at 17:32, Darin Adler wrote:

    > On Nov 20, 2007, at 6:58 AM, Alexander Griekspoor wrote:
    >
    >> Interestingly I can reproduce the issue in safari. If I navigate
    >> on the authenticated page and click on a PDF link the PDF will be
    >> shown fine in Safari. However if I right click on the same link
    >> and choose "Download linked file" it now downloads the html page
    >> where I would have to login again.
    >
    > I don't know what's changed in Leopard, but I'd really appreciate a
    > bug report.
    >
    > You can file one at http://bugreport.apple.com and then the team
    > that does the CFNetwork cookies and NSURLDownload can take a look
    > at it.
    >
    > -- Darin
    >
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today