Академический Документы
Профессиональный Документы
Культура Документы
Continue
A web site can have different applications,
each having individual properties.
When an application ends, it does not affect
the other applications.
Each application can be run in its own
memory space, resulting in more security fo
information.
An Application Object
An application object is used to store the
information that is common to an ASP
application and is shared by all the users of
the application.
ASP applications are used to retain
information that may be used by other web
pages. This is also called maintaining the
state in ASP.
Maintaining state
ASP applications are used to retain
information that may be used by other web
pages. This is also called maintaining state
in ASP.
An ASP application maintains two types
states:
The application state retains the information
of the application that is available to all the
users of the application.
Application Object
An Application object is used to initialize
an application, automatically start processes
that are required for an application, and
allow the declaration of variables that can
be used by all the users and across all the
pages.
Application Variables
Application variable is used to store data
that can be accessed throughout all the
pages of the application and by all the users
of the application.
An application can contain any type of data,
including arrays and objects.
Session Object
The session object is used to store the
information required for a particular session
by a specific user.
The variables stored in the Session object
are available to users throughout the
application for a particular session.
Cookies
Cookies store information about a user and are
used by a particular Web server that the user has
last visited. They are used to identify each user
who visits a Web site.
Netscape communications corporation was the
first to introduce cookies in its first browser. The
World Wide Web Consortium (W3C) has accepted
cookies as a standard that is now being adapted by
many of the browsers.
Continue
Cookies are browser-dependent. The browsers
may or may not have the capability of the cookies.
Browsers that support cookies maintain one or
more special files that store information from the
web.
The Response and Request objects have the
Cookies collection. The Cookies collection of the
Request object is used to retrieve the values of the
cookies sent in the HTTP request and the Cookies
collection of the Response object is used to set the
value of a cookie.
Creating a Cookie
A cookie is created using the Cookies
collection of the Response object. A cookie
can be of two types, a single value cookie
or a cookie dictionary, which contains
multiple name and value pairs.
If a specified cookie does not exist, it is
created.
Otherwise, it takes the new value and
discards the old value.
Attribute
Name
Domain
Type
Write-only
Expires
Write-only
HasKeys
Read-only
Name
Path
type
Write-only
Secure
Write only
Example
<%
Response.Cookies(loginName)=Jenie
%>
<%
Response.Cookies(loginName)=Jenie
Response.Cookies(password)=rose133
%>
Cookie dictionary
A Cookie dictionary is a single cookie with
multiple name and value pairs.
<%
Response.Cookies(userLogin)
(Name)=Jenie
Response.Cookies(userLogin)
(password)=rose123
%>
Name
HasKeys
Type
Read-Only