Solved

CInternetSession & OpenURL w/cookies

Posted on 1999-01-26
2
591 Views
Last Modified: 2009-12-16
I'm using CStdioFile, CInternetSession, & OpenURL to bring down web pages.  I've come across a web page that sets a cookie as a user session.

When I access it in VC++6.0 I get a "session timed out" page returned, "please turn on cookies".  If I turn off cookies on my IE4, my program prompts me to save, but regardless of if I do or not I can't get my webpage to load up.

Any help?
0
Comment
Question by:peshoff
2 Comments
 
LVL 1

Accepted Solution

by:
arbitrary earned 100 total points
ID: 1185211
As i can see it you should increase the server time out as the following :
m_pSession = new CInternetSession;
int nTimeOut= 30000;  
m_pSession->SetOption(INTERNET_OPTION_CONNECT_TIMEOUT,nTimeOut);
and adding the following option is useful as well.
m_pSession->SetOption(INTERNET_OPTION_CONNECT_BACKOFF,1000);
the wininet suppose to handle the cookies by default but you can
add your own handling by using Get / SetCookie in CInternetSession .

it looks like a time out problem only

0
 

Author Comment

by:peshoff
ID: 1185212
Thanks.  I will try out the timeout variable.  I may not be going to the page that sets the cookie initially, which I think may be the problem if the timeout doesn't work.

I thought that the wininet was supposed to take care of that by itself.  Thanks for your help.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

743 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

9 Experts available now in Live!

Get 1:1 Help Now