How to Add more than one cookie to the header [Answered]RSS

3 replies

Last post Mar 09, 2009 02:20 AM by carlechen

  • How to Add more than one cookie to the header

    Mar 08, 2009 03:24 AM|carlechen|LINK

    I still have some question.

    when i add a cookie to the header in the event SF_NOTIFY_SEND_RESPONSE pSendResponse->AddHeader(pfc,_T("Set-Cookie:"),_T("Cookie1=test;path=\;\r\n"));

    IIS surport this work.

    But I want to add more cookies to the header , i always get the fault result. who can help me?

    My Code:

    DWORD OnSendResponse(HTTP_FILTER_CONTEXT *pfc,
          PHTTP_FILTER_SEND_RESPONSE pSendResponse)

    {

     pSendResponse->AddHeader(pfc,_T("Set-Cookie:"),_T("Cookie1=test;path=\;\r\n"));

    pSendResponse->AddHeader(pfc,_T("Set-Cookie:"),_T("Cookie2=test;path=\;\r\n"));

    return SF_STATUS_REQ_NEXT_NOTIFICATION

    }

    iis6 ISAPI Filters

  • Re: How to Add more than one cookie to the header

    Mar 08, 2009 08:32 AM|carlechen|LINK

    IIS5.0

    I USe

    pSendResponse->AddHeader(pfc,_T("Set-Cookie:"),_T("Cookie1=test;path=\;\r\n"));

    the client can get the cookie.

    BUT in IIS6.0

    I alway get the GetLastError 87(parameter is not correct).

    I do not know why.

  • Re: How to Add more than one cookie to the header

    Mar 09, 2009 01:01 AM|anilr|LINK

    You should not have the \r\n in the header value.

    Anil Ruia
    Software Design Engineer
    IIS Core Server
  • Re: How to Add more than one cookie to the header

    Mar 09, 2009 02:20 AM|carlechen|LINK

    Thanks Anilr.

    I still have a problem.

    If i want to add more than one cookie to header. How can  i do it?