在会话和cookie中更安全 [英] in session and cookies which is more secure
本文介绍了在会话和cookie中更安全的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
任何人都可以在会话和cookie中告诉我哪个是最安全的吗?
感谢u
Hi
can anyone please tell me in session and cookie which is most secure?
Thank u
推荐答案
如果您只需要一行回答-会话比cookie更安全.
但是在实际应用中,并不是那么简单.在决定使用哪种状态管理之前,我们需要考虑很多事情.我建议您阅读有关状态管理的知识并做出决定.
希望本文能为您提供所需的答案: ASP.NET状态管理初学者教程 [
If you need a one line answer - Sessions are more safe then cookies.
But in real applications, it is not so straight forward. we need to consider a lot of things before deciding on which state management should be used. i suggest read something on state management and decide.
Hopefully this article will give you some answers you are looking for: A Beginner''s Tutorial on ASP.NET State Management[^]
Session state
消耗RAM或数据库资源,具体取决于您使用的提供程序(InProc与SQL).它还需要cookie,以便服务器将传入的请求与特定的Session
集合相关联.
对于类似站点ID的内容,建议您将其存储在cookie
中. 为获得最佳性能,请使用路径属性配置cookie ,以便浏览器不将其包含在对图像和其他静态文件的请求中.
引用类似的线程:会话与Cookie [
Session state
consumes either RAM or database resources, depending on which provider you use (InProc vs. SQL). It also requires a cookie, in order for the server to associate an incoming request with a particularSession
collection.
For something like a site ID, I would suggest storing it in acookie
if you can. For best performance, configure the cookie with a path property so the browser doesn''t include it with requests for images and other static files.
Refer similar thread: Session vs Cookie[^]
这篇关于在会话和cookie中更安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文