Wininet Credentials Are Not Reset on Keep-Alive Connections (195567)



The information in this article applies to:

  • Microsoft Internet Explorer 4.01 for Windows NT 4.0 SP 1
  • Microsoft Internet Explorer 4.0 for Windows NT 4.0
  • Microsoft Internet Explorer 4.01 for Windows 95 SP 1
  • Microsoft Internet Explorer 4.0 for Windows 95
  • the operating system: Microsoft Windows 98

This article was previously published under Q195567

SYMPTOMS

The Wininet InternetSetOption API call can be used to modify the credentials used for a HTTP request. However, if a previous successfully authenticated keep-alive connection has already been made with the server, Wininet continues to use the old credentials.

RESOLUTION

To resolve this problem, obtain and install Internet Explorer 4.01 Service Pack 2. You can obtain Internet Explorer 4.01 Service Pack 2 from the following Microsoft Web site:


STATUS

Microsoft has confirmed this to be a problem in the products listed at the beginning of this article.

MORE INFORMATION

The following example demonstrates the problem described in this article:

  1. Successful request using User, Password credentials: hOpen = InternetOpen(...) hConnect = InternetConnect ( hOpen,"Server", ..., User , password , INTERNET_SERVICE_HTTP,...) hReq = HttpOpenRequest (hConnect, "GET", Url , ...) HttpSendRequest (hReq, ...) InternetReadFile(hReq, ...)
  2. Modify the credentials using: InternetSetOption (..., INTERNET_OPTION_USERNAME , User2...) InternetSetOption (..., - INTERNET_OPTION_PASSWORD, Password2,...)
  3. The new request still uses User, Password credentials: hReq = HttpOpenRequest (hConnect, "GET", Url , ...) HttpSendRequest (hReq, ...) InternetReadFile(hReq, ...)
The fix detects if the credentials have been changed on a new request.

Modification Type:MinorLast Reviewed:11/15/2005
Keywords:kbHotfixServer kbQFE kbnetwork kbprb KB195567