Where exactly are session variables saved? Cookies? Server memory?
会话变量保存在哪里?饼干?服务器内存吗?
Again where are Application variables saved?
应用程序变量保存在哪里?
3 个解决方案
#1
41
Variables put into Session are stored wherever the configured SessionStateProvider
is configured to store them.
在配置的SessionStateProvider被配置为存储它们时,会存储到会话中的变量。
The default SessionStateProvider
uses what's referred to as In Process (InProc
) Session and the storage location for this is in server memory, inside the memory space of the ASP.NET worker process.
默认的sessionstateprovideruse所谓的进程(InProc)会话,它的存储位置在服务器内存中,在ASP的内存空间中。净工作进程。
You can configure your own SessionStateProvider
to store Session variables elsewhere, such as out of process, in a database.
您可以配置您自己的SessionStateProvider,将会话变量存储在数据库中的其他地方,如脱机。
Application variables are stored in ApplicationState
which is also stored in the memory space of the ASP.NET worker process. Unlike Session State, Application State applies to all users and sessions. As far as I am aware, There is no configuration to store ApplicationState elsewhere; if you need to store lots of application data then you may want to look at ASP.NET Caching.
应用程序变量存储在ApplicationState中,也存储在ASP的内存空间中。净工作进程。与会话状态不同,应用程序状态适用于所有用户和会话。就我所知,没有配置可以在其他地方存储ApplicationState;如果您需要存储大量应用程序数据,那么您可能需要查看ASP。网络缓存。
#2
12
Session variables are stored on Server Memory and Disk as Application Variables are.
会话变量作为应用程序变量存储在服务器内存和磁盘上。
From ASP.NET documentation:
从ASP。网络文档:
ASP.NET session state supports several storage options for session variables. Each option is identified as a session-state Mode type. The default behavior is to store session variables in the memory space of the ASP.NET worker process. However, you can also specify that session state should be stored in a separate process, in a SQL Server database, or in a custom data source. If you do not want session state enabled for your application, you can set the session mode to Off.
ASP。NET会话状态支持多个会话变量的存储选项。每个选项都被标识为会话状态模式类型。默认行为是在ASP的内存空间中存储会话变量。净工作进程。但是,您还可以指定会话状态应该存储在单独的进程中、SQL Server数据库中或自定义数据源中。如果不希望为应用程序启用会话状态,可以将会话模式设置为Off。
#3
3
For an InProc session, variables are stored locally in memory of ASP.NET worker process. Same goes for application state.
对于一个InProc会话,变量被本地存储在ASP的内存中。净工作进程。应用程序状态也是如此。
#1
41
Variables put into Session are stored wherever the configured SessionStateProvider
is configured to store them.
在配置的SessionStateProvider被配置为存储它们时,会存储到会话中的变量。
The default SessionStateProvider
uses what's referred to as In Process (InProc
) Session and the storage location for this is in server memory, inside the memory space of the ASP.NET worker process.
默认的sessionstateprovideruse所谓的进程(InProc)会话,它的存储位置在服务器内存中,在ASP的内存空间中。净工作进程。
You can configure your own SessionStateProvider
to store Session variables elsewhere, such as out of process, in a database.
您可以配置您自己的SessionStateProvider,将会话变量存储在数据库中的其他地方,如脱机。
Application variables are stored in ApplicationState
which is also stored in the memory space of the ASP.NET worker process. Unlike Session State, Application State applies to all users and sessions. As far as I am aware, There is no configuration to store ApplicationState elsewhere; if you need to store lots of application data then you may want to look at ASP.NET Caching.
应用程序变量存储在ApplicationState中,也存储在ASP的内存空间中。净工作进程。与会话状态不同,应用程序状态适用于所有用户和会话。就我所知,没有配置可以在其他地方存储ApplicationState;如果您需要存储大量应用程序数据,那么您可能需要查看ASP。网络缓存。
#2
12
Session variables are stored on Server Memory and Disk as Application Variables are.
会话变量作为应用程序变量存储在服务器内存和磁盘上。
From ASP.NET documentation:
从ASP。网络文档:
ASP.NET session state supports several storage options for session variables. Each option is identified as a session-state Mode type. The default behavior is to store session variables in the memory space of the ASP.NET worker process. However, you can also specify that session state should be stored in a separate process, in a SQL Server database, or in a custom data source. If you do not want session state enabled for your application, you can set the session mode to Off.
ASP。NET会话状态支持多个会话变量的存储选项。每个选项都被标识为会话状态模式类型。默认行为是在ASP的内存空间中存储会话变量。净工作进程。但是,您还可以指定会话状态应该存储在单独的进程中、SQL Server数据库中或自定义数据源中。如果不希望为应用程序启用会话状态,可以将会话模式设置为Off。
#3
3
For an InProc session, variables are stored locally in memory of ASP.NET worker process. Same goes for application state.
对于一个InProc会话,变量被本地存储在ASP的内存中。净工作进程。应用程序状态也是如此。