CAtlHttpClient Navigate fails

Posted on 2006-05-31
Last Modified: 2013-11-20
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.
Question by:ekartha
    LVL 22

    Expert Comment

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


    Author Comment

    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?

    Author Comment

    I found the solution

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


    Accepted Solution

    PAQed with points refunded (250)

    Community Support Moderator

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Host to IP 7 66
    Tab names are off by one 5 48
    post4 challenge 28 70
    Thin secure Windows 10 5 21
    Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
    Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now