Application of Asp.net Session and Cookie, sessioncookie

Source: Internet
Author: User

Application of Asp.net Session and Cookie, sessioncookie

Many developers know that Session is a server and Cooike is a client. Because the B/S mode is stateless, their applications must store some logon or encrypted information of the client.

Session exists on the server side. Of course, some server resources need to be occupied. When there are too many users, the server running speed and resources are inevitably affected. The Cookie exists on the client and does not occupy server resources. When the user browses the Cookie, the system reads the information in the Cookie and matches the information to reduce the security.

The expiration time of the Session is too short. The default value of Asp.net is 20 minutes, and the Cookie can be customized for a period of time, from 1 minute to 1 day and 1 year.

Sets the method of Session failure. You can set the Session expiration time to be longer, but I have not succeeded in the experiment. You can also set Session to SQL Server. I don't understand this. How can a good client Session be related to SQL Server. Refresh has been searched on the Internet. The method of regularly refreshing the page does not invalidate the Session. Add meta to the Head.

<Meta http-equiv = "refresh" content = "600"/> refresh once every 10 minutes

The new problem is. I use a form for users to enter information. If this is the case, when users enter half of the information, the information will be refreshed and the entered information will be lost. Of course this method is not suitable.

If the security requirements are not high, you can use cookies.

When Sessin or Cookie is used by all applications, you must determine whether the Session or Cookie is empty. If this parameter is left blank, a jump is required. Prompt the user to log on again or enter important information.

 

Recommended: http://hovertree.com/h/bjaf/vgwj5ad1.htm

 

Http://www.cnblogs.com/roucheng/p/texiao.html

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.