BUG: Session ID Is Lost When You Close a Browser Window (311072)
The information in this article applies to:
- Microsoft Internet Explorer (Programming) 5.5
This article was previously published under Q311072 SYMPTOMS
If you close a Web browser window that is hosted in Microsoft Visual Basic, Microsoft Foundation Classes (MFC), or other types of applications while you keep the process alive, you may lose cookies that are issued without an expiration date. Cookies that are issued without an expiration date are known as session cookies. If you lose sessions cookies, you lose your Microsoft Active Server Pages (ASP) and Microsoft ASP.NET session state.
CAUSE Internet Explorer ends the Internet session when you close the last browser window in the logon session.
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
RESOLUTION
Make sure that the Internet session is not ended when you close the last window. Set the DISPID_AMBIENT_OFFLINEIFNOTCONNECTED ambient property to VARIANT_TRUE so that Internet Explorer does not check an internal session count variable. For example, use the following sample code in an MFC application:
#include <idispids.h>
BOOL CGenhtmlviewView::OnAmbientProperty(COleControlSite* pSite, _
DISPID dispid, VARIANT* pvar)
{
USES_CONVERSION;
if (dispid == DISPID_AMBIENT_OFFLINEIFNOTCONNECTED)
{
pvar->vt = VT_BOOL;
pvar->boolVal = VARIANT_TRUE;
return TRUE;
}
return CHtmlView::OnAmbientProperty(pSite, dispid, pvar);
}
REFERENCESFor additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
300895 BUG: Session ID Lost When New Window Opened
Modification Type: | Minor | Last Reviewed: | 8/7/2003 |
---|
Keywords: | kbfix kbNavigation kbprb KB311072 |
---|
|