Solved

CInternetSession & OpenURL w/cookies

Posted on 1999-01-26
2
601 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

813 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

11 Experts available now in Live!

Get 1:1 Help Now