如何在同一浏览器的不同选项卡中管理会话? [英] How Do I Manage Session In Different Tabs Of Same Browser?

查看:201
本文介绍了如何在同一浏览器的不同选项卡中管理会话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站用于管理客户帐户。如果我通过网站访问CustomerA的帐户,然后打开一个新选项卡并访问CustomerB的帐户,持有客户ID更新的会话认为我现在正在使用CustomerB。然后,如果我点击返回CustomerA的标签并开始编辑该页面,我实际上正在编辑CustomerB的数据库记录。这已经发生并引发了各种各样的问题所以我需要找到一种傻瓜式的方法来阻止它。我不想将客户ID放在URL中,因为这会使其被滥用。

MY website is used to administer customer accounts. If I access CustomerA's account through the website then open a new tab and access CustomerB's account the session holding the customer ID updates to think I'm now working on CustomerB. Then if I click back to CustomerA's tab and start editing that page I am in fact editing the database record for CustomerB. This has happened and caused all sorts of problems so I need to find a fool proof way of stopping it. I don't want to put the customer ID in the URL as this will make it open to abuse.

推荐答案

IIS根据客户端的信息创建会话(当你从同一个浏览器浏览同一个站点时,IIS将在同一个会话中组合所有这些查询。

如果从同一个站点浏览同一站点的不同用户同样的浏览器是你的应用程序的现实,你不能使用IIS会话进行状态管理。

你可以在这里阅读 - https://support.microsoft.com/kb/899918 [ ^ ] ...

恕我直言,你只剩下两个选项:

1.让你申请无国籍......

2.做你自己的州管理......

我有同样的问题 - 同一个人 - 使用相同的浏览器 - 使用不同的交互式登录count ...我为每个登录分配一个GUID,并用它来管理该用户的会话状态......
IIS creates it's session based on information from the client (and keep it in cookie for trip-around), when you are browsing the same site from the same browser IIS will combine all those queries under the same session.
If browsing different users of the same site from the same browser is a reality for your application you can not use IIS session for state management.
You may read here - https://support.microsoft.com/kb/899918[^]...
IMHO you left with two options only:
1. Make you application stateless...
2. Do your own state management...
I have the same issue you have - where the same person - using the same browser - logs in with different accounts...I do assign a GUID to every login and use it to manage session state for that user only...


这篇关于如何在同一浏览器的不同选项卡中管理会话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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