声明数据存储在ASP.NET中的哪个位置? [英] Where does claim data stored in ASP.NET ?

查看:85
本文介绍了声明数据存储在ASP.NET中的哪个位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户在哪里声明存储在客户端计算机中的数据?

1)Cookies

2)缓存

3)本地存储
4)否则

请帮助。



我知道令牌存储在本地存储中,会话ID存储在cookie中,但索赔数据存储在哪里?



我尝试过:



Where does user claim data stored in client computer ?
1)Cookies
2)Cache
3)Local Storage
4)Else
Please help.

I know token gets store in local storage, session Id gets stored in cookies, but where does claim data gets stored ?

What I have tried:

var claims = new[]
{
 new Claim(ClaimTypes.NameIdentifier, userFromRepo.Id.ToString()),
  new Claim(ClaimTypes.Name, userFromRepo.Username)
 };





这里,我保留了用户名和ID在索赔中,但它存储在哪里。我认为它将存储在cookie中。我是对的 ?帮帮我



Here ,I have kept Username and Id in claim ,but where does it stored. I think it will store in cookies. I am right ? Help me

推荐答案

是的。它基本上在用户的浏览器上创建一个加密的cookie。删除cookie或cookie过期后,将删除声明数据。
Yes. It basically creates an encrypted cookie on the user's browser. The claims data will then be deleted once you remove the cookie or when the cookie expires.


取决于运行代码的环境:Web应用程序的存储将与存储非常不同在WinForms应用程序中(并且可能会分散在其中的几个中)
Depends on the environment the code is running under: storage for a web app will be very different from storage in a WinForms app (and will probably be spread across a couple of those in either)


这篇关于声明数据存储在ASP.NET中的哪个位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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