Turn: questions about cookies and sessions in ASP. NET (cookies are disabled)

Source: Internet
Author: User

Q:
How to determine whether the client cookies are disabled originally means that cookies are disabled, and then I use session to store data. However, sessionid is also stored in cookies. Therefore, when cookies are disabled, the session cannot be used.
Later, I found it online.
The session Status of the client in ASP. NET is stored in the session model introduction above. You can find that the session status should be stored in two places: the client and the server. The client is only responsible for saving the sessionid of the corresponding website, while other session information is stored on the server. In ASP, the sessionid of the client is actually stored as a cookie. If the user chooses to disable the cookie in the browser settings, then he will not be able to enjoy the convenience of the Session, and even lead to access to some websites. To solve the above problems, the session information storage methods of the client in ASP. NET are divided into cookie and cookieless.
I installed this method to store the session, but these things will appear in the address bar. Http: // localhost/mytestapplication/(ulqsek45heu3ic2a5zgdl245)/default. aspx looks pretty bad. I gave up this method.

Return 1:
I am responsible for telling you that if the client disables cookies, you can ignore them at all. In addition, any website uses cookies to package portals in China. If cookies are disabled, it makes no sense. Therefore, you can directly consider the cookie idea when making a website. Of course, you can make a decision to use session to store the customer information that disables cookies.

Back to 2:
You can also set cookieless to autodetecte in Web. config, so that the cookie-enabled client URL is normal, and the cookieless URL is used if cookieless is not enabled.

3:
no other options are available. You must be prompted to enable cookies. This is done in all major forums.

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.