When you click a hyperlink in an application that is hosting the WebBrowser control, a new page opens in Internet Explorer. In this scenario, the session cookie is lost, and you may have to log on again. This behavior occurs because Internet Explorer is a different process than the application process. A session cookie cannot be shared between processes. To maintain the session state in this scenario, you can use the NewWindow2 event to open the new page in another form in the application. This event is triggered by the WebBrowser control. For more information, visit http://support.microsoft.com/kb/184876
you can use the NewWindow2 event to open the new page in another form in the application
MVP兄弟,你知道Microsoft的KB怎么能看英文原文的么? 翻译出来的文档太难读了。
Session一般是通过会话Cookie实现的,IE的会话Cookie不能跨进程,用IE打开弹窗没有另起进程,而你的程序TWebBrowser弹窗后起了IE进程(与你的程序不是同一进程),所以失效。要解决,象jiangsheng(蒋晟.Net[MVP]) 说的,捕获 TWebBrowser 的弹窗事件,to open the new page in another form in the application.....注意“another form in the application”
For more information, visit
http://support.microsoft.com/kb/184876
翻译出来的文档太难读了。