This article is a mirror article of machine translation, please click here to jump to the original article.

View: 17768|Reply: 1

[ASP.NET] sessionState configuration scheme cookieless

[Copy link]
Posted on 12/28/2015 6:28:45 PM | | | |

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.





Previous:Redis modifies the default port number and sets the access password
Next:Redis . .NET open-source component Beetle.Redis
 Landlord| Posted on 9/25/2018 11:07:43 AM |
ASP.NET StateServer that stores the Session
https://www.itsvse.com/thread-4258-1-1.html
(Source: Architect_Programmer)
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com