Storage of the client session state in the ASP.NET In our introduction to the Session model above, you can see that the session state should be stored in two places, namely the client and the server side. The client is only responsible for saving the session ID of the corresponding website, while other session information is stored on the server side. In ASP, the client's SessionID is actually stored as a cookie. If the user chooses to disable cookies in the browser settings, he will not be able to enjoy the convenience of the session and may even be unable to access certain websites. In order to solve the above problems, there are two types of session information storage methods in the ASP.NET: cookies and cookiesless. In ASP.NET, the client still uses cookies to store session information by default. If we want to use cookiesless on the client to store session information, the following is the method: Find the root directory of the current web application, open the Web.Config file, and find the following paragraph: <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1; Trusted_Connection=yes" cookieless="false" timeout="20"
/> cookieless="false" in this paragraph is changed to cookieless="true", so that the client's session information is no longer stored by cookies, but is stored through the URL. Closing the current IE, opening a new IE, and re-accessing the web application will look like this: Among them, the bold font in http://localhost/MyTestApplication/(ulqsek45heu3ic2a5zgdl245)/default.aspx is the client's Session ID. Note that this information is automatically added by IIS and does not affect the previous normal connection.
|