跨浏览器共享的ASP.NET Core身份 [英] ASP.NET Core identity shared across browser

查看:96
本文介绍了跨浏览器共享的ASP.NET Core身份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将ASP.NET Core Web应用程序部署到Azure时,会话出现问题:它们在浏览器之间共享.

When I'm deploying an ASP.NET Core web application to Azure, I have an issue with the session : they are shared across browsers.

说明:我要进入已部署的站点,然后使用电子邮件/密码登录,然后登录.如果我在同一台计算机或另一台计算机上的其他浏览器中打开该网站, m现在与我在第一个浏览器中使用的凭据有关.

Explanation : I'm going to my deployed site, I log in with my email/password then I'm logged in. If I open the website in an other browser on the same machine or on an other machine, I'm now connected with the credentials I used in the first browser.

我从Visual Studio部署了默认模板,没有进行任何更改. 有什么事情可以解决这个问题,还是我错过了什么?

I deployed the default template from Visual Studio without any changes. Is there something to do to resolve this issue or am I missing something ?

推荐答案

可以肯定,此功能是设计使然的……并且很有道理-如果您打开了另一个功能,则无需重新进行身份验证标签以查看在线银行中的文档,是吗?

Pretty sure this functionality is by design... and it makes a lot of sense - you wouldn't want to have to re-authenticate if you opened another tab to view a document in your on-line banking would you?

如果您需要登录时不与现有浏览器共享cookie(将是cookie保留对会话的引用,以确保服务器知道您的身份),则需要启动新会话.对于Internet Explorer,这只是文件>>新建会话.

If you need to logon without sharing the cookies with existing browser (it will be the cookies that are holding the reference to the session that ensures the server knows who you are) you need to start a new session. For Internet Explorer this is simply File >> New Session.

对于Chrome来说,它稍微复杂一些,但在这里进行了说明... 每个窗口的单独会话

For Chrome it is a little more complicated but explained here... Separate session for each window

这篇关于跨浏览器共享的ASP.NET Core身份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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