对这个特定网站的所有浏览都应该发生在它登录的实例内。如果在新选项卡或新窗口中打开,它不应允许并排浏览。换句话说,如果我已经在浏览(并登录),并决定打开一个新的标签/窗口来浏览同一个站点,我的服务器应该捕获这个,并报告一条友好的消息。
这可能吗?我也想知道这个要求的跨平台可行性。
We put in a real quick and dirty for this on an internal system when IE7 came out due to the changes in the way session carried across tab instances from IE6.
This was ASP and used a combination of Session and Javascript, but could easily be ported to ASP.NET. Worked for us without a problem until we replaced it with registry hacks to change IE TAB behaviour.
If this is for an open system it's probably no good unless you are happy to require JavaScript but guess it might help you in some way.
<script language="JavaScript">
<%if session("window") = "" Then%>
window.name = "LOCKwindow";
<%session("window") = "set"%>
<%else%>
if (window.name != 'LOCKwindow') {
document.write('<h1>Sorry just one tab allowed</h1>');
}
<%end if%>
</script>