CAtlHttpClient Navigate fails

I have code as follows
I am sending a cookie as extra headers and sending some xml as post data
and navigating to a URL as follows

CAtlNavigateData  navData;
navData.SetExtraHeaders("Cookie:SessionID=" + strSessionId + ";");

CAtlHttpClient cli;

if(!cli.Navigate(&m_urlServer, &navData))
     //It always fails If I send Extra headers

Navigate always returing false.....
I am using Tomcat as the web server
If I remove the line navData.SetExtraHeaders("Cookie:SessionID=" + strSessionId + ";");
It works fine...BUt I need to send the sesionid as a cookie

Help me.
Who is Participating?
PAQed with points refunded (250)

Community Support Moderator
Have you tried to execute CAtlHttpClient::NegotiateAuth() method before calling Navigate() ?
CAtlHttpClient::NegotiateAuth() attempts to meet the security requirements of the requested URL.... <==

ekarthaAuthor Commented:
No the problem is different.
If I set Cookie header before navigate It gets failed...If i remove the line of setting Cookie as extra header
it works fine.

the same thing works for Pramati Server...
But it doesn't work for TomCat server

Is there any se rver side settings?
ekarthaAuthor Commented:
I found the solution

we need to send a newline after the Cookie header as follows
navData.SetExtraHeaders("Cookie:SessionID=" + strSessionId + "\r\n");

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.