Chapter 2 ASP applications and Sessions
In the previous sections, we introduced ASP's methods for accessing a customer request and generating responses. This chapter will discuss the other two ASP objects. Is the Application and Session object. These two objects are not directly related to the management of requests and responses, but more related to the management of the ASP webpage runtime environment.
One of the common problems related to creating a Web site or a Web application is that HTTP is stateless. Status provides variable values, objects, and other resources related to a specified user, and can be used by any routine in the application; when you write a customer-based application in a programming language such as VB or C ++, you can use the status to complete relevant work. However, Web does not provide this capability. In this chapter, you will see why and how to avoid this problem.
This chapter also involves some terms and technical issues. So far, this book has briefly discussed "Web Applications", but does not really understand or accurately define what they are. This book also involves "user sessions" and does not have a complete description. The content is omitted intentionally because it is closely related to ASP applications and sessions. The following describes ASP Application and Session objects.
Main contents of this chapter:
· What are Web applications and how they are associated with ASP Application objects.
· How does ASP automatically create and manage applications and sessions.
· Functions provided by Application and Session objects.
· How to put Application and Seesion objects into ASP web pages.
First, we will study the core issue of the entire content: status.
3.1 Web status management
Many developers have never considered the concept of status before passing applications to the Web. As mentioned earlier, Web is a stateless environment. Therefore, we should discuss what the status is and learn how to avoid problems.
3.1.1 precise status definition
When creating an executable application in a single user program, for example, you can use vbto create an .exe file, declare a global (or Public) variable, and then access it anywhere in the code. The time value is always valid and accessible at all times when the application is running.
For a traditional client/server solution, such as a client-based application that accesses a server-based database engine, each client establishes a connection with the server and database application. This connection is usually established by verifying the user.
The authentication process is a typical process of identifying a user. A user name and password combination is used to verify whether the user is a legal user.
Once verification is passed, a connection is established between the client and the server-based application. The connection remains valid for all the time users use the application. This happens when a user registers for a Windows 2000 Server. Whenever the administrator uses the "Active Directory Users and Computers" utility (click the "Directory Management" item in the "Administrative Tools" option in the "Start" menu) you can see the active user connection. This process is the same in many systems, such as Microsoft SQL Server.
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