Out-of-process Mode
Included with the .NET SDK is a Windows® NT service: ASPState. This Windows service is what ASP.NET uses for out-of-process session state management. To use this state manager, you first need to start the service. To start the service, open a command prompt and type:
net start aspstate
What you'll see is:
.gif)
Figure 1. Starting the Windows NT service ASPState at the command prompt
At this point, the Windows NT Service ASPState has started and is available to ASP.NET. Next, we need to configure ASP.NET to take advantage of this service. To do this we need to configure config.web:
<configuration>
<sessionstate
mode="stateserver"
cookieless="false"
timeout="20"
sqlconnectionstring="data source=127.0.0.1;user id=<user id>;password=<password>"
server="127.0.0.1"
port="42424"
/>
</configuration>
We changed only from inproc mode to stateserver mode. This setting tells ASP.NET to look for the ASP state service on the server specified in the server and port settings—in this case, the local server.
We can now call SessionState.aspx, set a session state value, stop and start the IIS process (iisreset), and continue to have access to the values for our current state.
'Development > .NET' 카테고리의 다른 글
| BitTorrent 방식의 기술 이해 (0) | 2007.05.24 |
|---|---|
| FarPoint Spread를 이용한 ActiveX 페이지와 스크립트 제어 (1) | 2007.05.23 |
| TCP, 네트워크정보 보는 프로그램 (0) | 2007.05.21 |
| HTTP Debugging Proxy - Fiddler (0) | 2007.05.21 |
| ASP.NET 페이지 캐쉬를 사용하지 않도록... (2) | 2007.05.18 |