?
Solved

wininet session

Posted on 2006-06-01
7
Medium Priority
?
444 Views
Last Modified: 2013-12-03
I am trying to log into webmin using wininet.  I use the following functions:

InternetOpen();
InternetConnect();
HttpOpenRequest();
HttpSendRequest();
InternetReadFile();

The problem is what I read back is:
<h1>Error - No cookies</h1>
<pre>Your browser does not support cookies, which are required for this web serv
er to work in session authentication mode</pre>

How do I make my wininet application support cookies?
0
Comment
Question by:lwinkenb
  • 3
  • 2
6 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 16808882
Check your IE settings, if they are set to not allow cookies, that will affect Wininet, too.
0
 
LVL 5

Author Comment

by:lwinkenb
ID: 16808984
I can log in just fine with IE.  My guess is that I either have to do one of the following:

- Pass an option to one of the functions I listed above that tells the session I am accepting cookies
- Pass an additional HTTP header which tells the server I accept cookies
- Write the cookie manually somehow

I've been reading the wininet documentation, but I haven't come across anything substantial yet.
0
 
LVL 86

Expert Comment

by:jkr
ID: 16810269
>>I've been reading the wininet documentation, but I haven't come across anything substantial yet.

As long aas you do *not* pass INTERNET_FLAG_NO_COOKIES to 'HttpOpenRequest()', it should work.
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 5

Author Comment

by:lwinkenb
ID: 16810367
I'm not passing INTERNET_FLAG_NO_COOKIES, but it still isn't working.
0
 
LVL 5

Author Comment

by:lwinkenb
ID: 16810379
Here is what my HttpOpenRequest looks like:

hRequest = HttpOpenRequest(hSession,NULL,"/session_login.cgi?user=root&pass=mypassword","HTTP/1.1",NULL,(const char**)mediaTypes,
            INTERNET_FLAG_SECURE | INTERNET_FLAG_IGNORE_CERT_CN_INVALID |
            INTERNET_FLAG_IGNORE_CERT_DATE_INVALID | INTERNET_FLAG_KEEP_CONNECTION |
            INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_NO_UI |
            INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_RELOAD,0);
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 16877465
Closed, 500 points refunded.
ee_ai_construct
Community Support Moderator
replacement part #xm34
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

750 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