問題描述
我們正在將基于 Web 的軟件從帶有 Internet Explorer 6 的 Windows XP 升級到帶有 Internet Explorer 9 的 Windows 7.
We are upgrading a web-based software from Windows XP with Internet Explorer 6 to Windows 7 with Internet Explorer 9.
此外,Webbrowser 對象在 WPF 應用程序中使用.
Furthermore, a webbrowser object is used inside a WPF application.
我們現在有一個奇怪的行為,當打開一個帶有 url 的窗口時(使用類似 window.open(url) 的指令),ASP 會話丟失"并且新窗口與一個新的從頭開始的會話一起工作.
We now have a strange behavior, when opening a window with a url (with an instruction like window.open(url)), the ASP session is "lost" and the new window works with a new from scratch session.
我通過避免打開無用的窗口解決了這個問題,而是修改了當前窗口的位置.但我想了解為什么會出現這種行為!
I solved this issue by avoiding useless windows opening and instead, I modify the location of the current window. But I would like to understand why this behavior !
你有什么線索嗎?
謝謝.
推薦答案
假設您的導航都轉到同一個域,那么另一個原因可能是進程切換.從 IE8 開始,IEchrome"和 tab 內容被分成兩個進程.進一步的IE可以為不同窗口和標簽中的內容創建多個內容進程.
Assuming your navigation all go to the same domain then another cause for this could be the switching of processes. As of IE8 the IE "chrome" and tab content were seperated into two processes. Further IE can create multiple content processes for content in different windows and tabs.
如果您的應用程序托管了一個 Web 瀏覽器控件,該控件隨后會啟動一個完整的 IE 窗口,那么您的新 URL 可能是由另一個進程 (iexpore.exe) 而非您的應用程序進程請求的.結果,請求無法訪問會話 cookie,因此會話顯示為丟失".
If your app is hosting a webbrowser control which then launches a full IE window, the chances are that your new URL is being requested by another process (iexpore.exe) not your apps process. As a result the request does not have access to session cookies hence the session appears "lost".
(值得注意的是,同一進程樹中的多個 iexplore.exe 進程實例具有相互共享會話 cookie 的方法.
(Its worth noting that the multiple iexplore.exe process instances in the same process tree have a means of sharing session cookies with each other).
這篇關于打開一個新窗口創建一個新會話的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!