The InProc of Session mode is changed to StateServer, the website cannot be accessed

Source: Internet
Author: User
ASP.net's session mode InProc changed to StateServer, the site can not be accessed

<sessionstate mode= "InProc" cookieless= "false" timeout= "/>"
I changed the InProc to StateServer, the website is not accessible, and my WAP site is C #. Database sql2000, want to implement a session is not period of conversation, timeout changed, seems to not work
Session mode several states

When developing asp.net applications, modify the sessionstate nodes in the web.config.

StateServer mode: <sessionstate mode= "StateServer" stateconnectionstring= "tcpip=127.0.0.1:42424" sqlconnectionstring= "Data source=127.0.0.1; Trusted_connection=yes "cookieless=" false "timeout="/>

<sessionstate mode= "StateServer" stateconnectionstring= tcpip=127.0.0.1:42424 "sqlConnectionString=" data source=127.0.0.1; Trusted_connection=yes "cookieless=" false "timeout="/> InProc mode: <sessionstate mode= "InProc"   stateconnectionstring= "tcpip=127.0.0.1:42424"  sqlconnectionstring= "Data source=127.0.0.1; Trusted_connection=yes " cookieless=" false "timeout="/> 

<sessionstate mode= "InProc stateconnectionstring=" tcpip=127.0.0.1:42424 "sqlconnectionstring=" Data source= 127.0.0.1; Trusted_connection=yes "cookieless=" false "timeout="/> InProc mode benefits: Gets the session state faster, and it is stored directly in the IIS process. Disadvantage: Easy to lose, often need to login  
StateServer Mode Benefits: Session state is stored separately in a process and does not lose state disadvantage because of the restart of IIS or applications: getting session state is slower than InProc. After all, there are two different processes. &NBSP
When developing, a little modification to the application will cause the application to restart, at which point if you use the InProc mode, you need to log in again, which is a waste of time. It is recommended that StateServer mode be used. and set the timeout longer in IIS.
Note: When using StateServer mode 1, to turn on the "ASP.net State Service" (set to "automatic") status service
2, If the value of stateconnectionstring is not a value that represents a local address, such as 127.0.0.1 or localhost, you need to modify the registry: Hkey_local_machine\system\currentcontrolset\ Services\aspnet_state \parameters node → set allowremoteconnection key value to "1" (1 to allow remote computer connection, 0 is forbidden) → Set port (port number)
3, session If the violation throws a   cannot serialize session state. In either "StateServer" or "SQL Server" mode, ASP.net will serialize the session-state object, so objects that cannot be serialized or MARSHALBYREF objects are not allowed. The same restriction applies if the custom session state store performs a similar serialization in custom mode. Such an exception. If you store a custom object to the session, you must add a [Serializable] comment to the object's class.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.