停止在浏览器的多个选项卡之间共享会话状态 [英] Stop Sharing Session State between Multiple Tabs of Browser

查看:101
本文介绍了停止在浏览器的多个选项卡之间共享会话状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

场景:
默认情况下,所有浏览器在多个选项卡之间共享会话状态.因此,如果您登录了具有特定站点的一个选项卡并在新选项卡中打开了同一站点的内部链接,则不必担心再次登录.它会自动将您声明为登录用户.

例如,如果我打开google并登录到google.com.现在,我在同一浏览器中打开新标签页,然后输入gmail.com,它将自动登录并重定向到Google Mail,在此步骤中,它不会要求我再次登录.

要求:

如果我是站点中客户帐户的管理员.现在,我要访问客户"ABC"的帐户,然后打开新标签并访问客户"PQR"的帐户.该会话现在正在保存有关客户"PQR"的信息,并认为我正在处理客户"PQR".现在,在处理客户"PQR"之后,我回到客户"ABC"(选项卡)并开始对其进行编辑.实际上,根据会话信息,再次假设我正在编辑客户"PQR",问题从这里开始(数据差异).

因此,请让我知道如何为浏览器的每个实例创建唯一的会话?

解决方案

更改以下配置设置(Web .config文件)

<   sessionstate     ="   InProc" 无Cookie   > UseUri"  >  <  /sessionstate  >  


使用帐户中的唯一密钥将您的数据存储在会话中.

AFAIK这是浏览器的功能,您无法控制.用户将需要在某些浏览器中启动使用私有浏览功能.

您可以通过在页面上放置一个具有不同值以区分请求的隐藏控件来解决该问题.


Scenario:
By default all browsers share session state between multiple tabs. So if you logged into one tab with particular site and open internal link of the same site in new tab, you need not to worry to login again. It will automatically declare you as logged in user.

For example, if I open google and login to google.com. Now I open new tab in the same browser and type gmail.com then it will automatically logged in me and redirect to google mail, here at this step it will not ask me to log in again.

Requirements:

If I am administrator of customer accounts in site. Now I am accessing account of customer "ABC" and then open new tab and access account of customer "PQR". The session is now holding information for customer "PQR" and thinks that I am working on customer "PQR". Now after working on customer "PQR", I am coming back to customer "ABC" (tab) and start editing it. Actually according to session information it is assuming again that I am editing customer "PQR" and the problem starts here(data discrepancy).

So please let me know how i can create a unique session for every instance of browser ?

解决方案

change the following config setting (Web.config file)

<sessionstate mode="InProc" cookieless="UseUri"></sessionstate>


Use the unique key from an account to store your data in the session.


AFAIK this is a function of the browser, which you have no control over. The user would need to initiate using the private browsing feature in some browser.

You may be able to work around it by placing a hidden control on the page that has different values to differentiate between requests.


这篇关于停止在浏览器的多个选项卡之间共享会话状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆