在asp.net中使用多个会话会导致任何问题 [英] using of multiple session in asp.net causes any problem

查看:76
本文介绍了在asp.net中使用多个会话会导致任何问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用了这么多会话..所以我曾经认为它会导致任何问题,比如慢处理等......

i am using so many sessions in my project ..so i had dought that it causes any problem like slow processing etc....

推荐答案

这取决于关于你在会话中存储的内容以及可用于存储该值的替代方法。



有时而不是多次往返数据库服务器,更好地将事物保存在视图状态或会话变量中。

但是应该记住,会话存储在Web服务器(inProc)上,并且如果在其中存储非常重的对象,则可能会降低性能。
That depends on what you are storing in session and what is the alternate method available to you to store that value.

sometimes instead of doing round trip to db server multiple times, its better to keep things in viewstate or in session variables.
However it should be kept in mind that session is stored on web server (inProc) and can slow down the performance if you store very heavy objects in that.


首先,他们可能会多次访问数据库中的数据来提取会影响性能的数据。还有



优点:



-它有助于维护整个应用程序的用户状态和数据。

-它可以很容易地实现,我们可以存储任何类型的对象。

-分别存储每个客户数据。

-会话安全且透明。



缺点:



- 大量用户的性能开销,因为会话数据存储在服务器内存中。

-参与序列化和反序列化会话数据的余量。因为在StateServer和SQLServer会话模式的情况下,我们需要在存储之前对对象进行序列化。



您可以参考使用Session变量的优点/缺点是什么?
First of all,they may be accessing the data in the database too many times to pull the data which will affect performance.Further

Advantages :

-It helps to maintain user states and data to all over the application.
-It can easily be implemented and we can store any kind of object.
-Stores every client data separately.
-Session is secure and transparent from user.

Disadvantages :

-Performance overhead in case of large volume of user, because of session data stored in server memory.
-Overhead involved in serializing and De-Serializing session Data. because In case of StateServer and SQLServer session mode we need to -serialize the object before store.

You can refer to what are the advantages / disadvantages of using Session variables?


是的,它可能会降低您的应用程序性能,因为它存储在服务器内存中。

而不是在会话中存储尝试以加密格式存储在Cookie中。
Yes it may slow down your application performance, because it is stored in Server Memory.
Instead of storing in session try to store in Cookies in encrypted format.


这篇关于在asp.net中使用多个会话会导致任何问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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