Introduction to Cookies Method

Advertisements

  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Detail

Introduction to Cookies Method

A basic information on using Cookies in ASP. An access counter is used as an example.
http://www.asptutorial.info/learn/Cookies.asp
  • Total Hits: 12091

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating

  •  

  • Total Votes: 139 votes

  • Category: ASP/Cookies and Sessions

  • Submitted on: 2008-03-06 09:00:44

  • Submitted By: Devesh Khanna

  • Set as Favorite

Description:

ookies method is very similar to Session method: the basic difference is that with Cookies method the information is save in the clients computer and not in the server, so it is more suitable for sites with a lot of visitors. This method implies sending information to the client and requesting it whenever the information is needed. Additionally, we will learn how to delete the information save in the clients computer when it is not necessary anymore.

When the visitor gets to our asp file we may save information related with him in his computer. The order will be like this one:

<% response.Cookies ("whatever")="information" %>

When this line is executed, the visitor will have the information in his computer, and whenever we need that information, we may request it using this code:

<% =request.Cookies ("whatever") %>
or
<% variable1=request.Cookies ("whatever") %>


Let's try an example using Cookies method: let's consider we have visitors checking our site several times and we want to let them know how many times they have accessed to our computer.    More detail...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 38.85%  54
 Two starsTwo star  Vote LeftVote MiddleVote Right 10.07%  14
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 11.51%  16
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 10.79%  15
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 28.78%  40

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.





Advertisements
Advertisements