Article ID: 311072 - Last Review: August 7, 2003 - Revision: 2.1 BUG: Session ID Is Lost When You Close a Browser WindowThis 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:
MORE INFORMATION
Internet Explorer maintains a session count that tracks the number of instances of the browser window in the logon session. Whenever the logon session count becomes 0, the process that closes the last window ends the Internet session by calling the InternetSetOption function (INTERNET_OPTION_END_BROWSER_SESSION). This technique causes the symptoms that can appear in two common situations:
REFERENCESFor additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
300895
(http://support.microsoft.com/kb/300895/EN-US/
)
BUG: Session ID Lost When New Window Opened
| Article Translations
|


Back to the top
