Session in ASP. NET is the best process I have ever seen and is unmatched by other dynamic web page technologies. Session in ASP. NET no longer requires the support of cookies. That is to say, if the cookie is disabled, the session value can also be saved.
However, we need to make some preparations for the config. Web file, because we find the session setting text in it, such:
<Sessionstate
Cookieless = "false"
/>
Change cookieless = "false" to cookieless = "true", so the session will not be stored in cookies, but stored in URLs.
In fact, I found that you do not need to change the config. Web file. After you turn off cookies, you can still pass session values without using URLs. In this case, it is not clear how the session is preserved :)
The session can also remain immortal, that is, when the server is restarted, it can still ensure that the value in the session remains unchanged, but this requires changing the config. Web file. It is also set through the following statement.
<Sessionstate
Inproc = "false"
Server = "localhost"
Port = "42424"
/>
Is it true that the session here is very powerful? :) change localhost to the host you want, and the session can be maintained on another host.