会话在浏览器关闭时过期. [英] session expired on browser close.

查看:129
本文介绍了会话在浏览器关闭时过期.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如果我在2个具有不同登录凭据的相同浏览器中打开我的应用程序.
现在,如果我关闭一个浏览器,则另一个浏览器的会话自动过期.

如何解决这个问题?

Hi,

If i open my application in 2 same browser with different login credential.
Now, if i close one browser, then automatically session of another browser expired.

how to solve this problem?

thanks in advance.

推荐答案

检查session_expires事件
Check for the session_expires event
may it helps you.


您可以在Application对象中维护用户列表并使用.contains来查看它是否已经存在.

与以自动方式进行操作相比,最好使用session_expires事件中的Session.Abandon()手动放弃会话.

更好地了解应用程序状态和会话状态之间的区别.
同时使用这两种状态来解决您的问题

您几乎不必花3行代码.

祝您好运
you can maintain a list of users in the Application object and use .Contains to see if it already exists.

rather than going in an automatic manner it''s better to abandon the sessions manually using Session.Abandon() in session_expires event .

Its better for you to know the difference between application state and session state.
Use these both states to solve your problem

hardly it may be 3 lines of code you have to wright.

Good Luck


这与在浏览器"标签之间共享会话的原因相同.好吧,这不是我们所能控制的.但是请看一下我建议的关于如何为选项卡式浏览器分隔/设置不同会话的答案.这可能会有所帮助!
这个:在多标签浏览器中的唯一会话 [
This is kind of same as why Session is shared across browsers tab. Well, it''s kind of not much in our control. But do have a look at this answer I suggested on how to seperate/have different session for tabbed browser. It might help out!
This one: Unique session in multitab browser[^]


这篇关于会话在浏览器关闭时过期.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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