ASP. NET session

Source: Internet
Author: User
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.

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.