带有Duende IdentityServer的ASP.NET核心 - 如何清除cookie
我使用duende IdentityServer进行身份验证的ASP.NET Core MVC应用程序,并且具有一旦用户进行认证,它也会启动Angular Spa。
用户注销后,我试图清除服务器端的cookie。
foreach (var cookie in Request.Cookies.Keys)
{
Response.Cookies.Delete(cookie);
}
但是,如果另一个用户在同一选项卡或其他选项卡甚至新的浏览器会话中再次登录,则以前的用户数据仍在应用程序使用的会话cookie中。 我必须先到期饼干吗? 当我检查请求时,我仍然在其中看到它们,因此打开新选项卡或启动新的浏览器时,是从服务器发送回的cookie吗? 以前的用户注销时不会删除它们?
I have an ASP.NET Core MVC Application using Duende IdentityServer for authentication and also have an Angular SPA that is launched once a user is authenticated.
After user logs out I am trying to clear cookies as follows on the server side.
foreach (var cookie in Request.Cookies.Keys)
{
Response.Cookies.Delete(cookie);
}
However if another user logs in again on the same tab or another tab or even a new browser session, previous users data is still in the session cookie that the application uses.
Do I have to expire the cookie first.
When I check the Request.Cookies I still see them in there so when a new tab is opened or a new browser is started is the cookies sent back from the Server?
Will they not be removed when the previous user logs out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论