ASP.NET
  Home arrow ASP.NET arrow Databases and Cookies
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Databases and Cookies
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 7
    2004-11-03

    Table of Contents:
  • Databases and Cookies
  • Key Points About Cookies
  • Looking at your cookies
  • Examples of Using Cookies
  • Try It Out – Setting and Reading a Cookie with ASP Alone
  • How it Works – Setting and Reading a Cookie with ASP Alone
  • Using Cookies with ADO and a Database
  • Try It Out – Setting a Cookie Using ASP–ADO
  • How it Works – Setting a Cookie Using ASP–ADO
  • Resetting a Cookie
  • Try It Out – Resetting a Cookie
  • How It Works – Resetting a Cookie
  • Summary

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Databases and Cookies


    (Page 1 of 13 )

    Learn about two of the cornerstones of programming applications for the Web: Databases and Cookies. The first section is a review for those not familiar with the subject. Jump to the section titled "Using Cookies with ADO and a Database" for some advanced action. (This is chapter 11 of Beginning ASP Databases by Kauffman, Spencer, and Willis; Apress, ISBN 1590592492.)

    Databases and CookiesDatabases and Cookies

    From a programmer's standpoint, one great problem of the web is the lack of an intrinsic identification of visitors. Cookies provide a means of identifying visitors, with their approval, so that continuity can be established between visits. Cookies are limited in the amount of information they can hold but, by storing an identification number in a cookie, we can then use that ID with ASP-ADO to look up a returning visitor in our database, and thus have all of the visitor's data available.

    Review of Cookies

    The following section provides a review of the purpose of cookies and a few key points to remember about cookies. If you have been working with ASP pages for very long you are probably already familiar with the basics and can skip to the section entitled "Using cookies with ADO and a Database." The topic of cookies is also covered in depth in Beginning and Professional Active Server Pages (ISBN 1-861001-34-7 and 1-861001-26-6) with additional information on cookies in the context of sessions and applications.

    Purpose of Cookies

    Cookies were created to overcome the problem of identifying visitors to the site for the purpose of maintaining some continuity between requests. There is no mechanism built into the World Wide Web that states the name of the PC that is sending a request, or that provides the ability to sense that a series of requests are all coming from the same visitor. Recall that the WWW was originally designed to provide rapid and universal access to pages of information. There was no need for a system to track a series of requests as being from the same user. Implementation of that type of continuity would slow down the server.

    However, modern sites provide a more interactive experience, which frequently requires that the server has an identification of the visitor. For example, visitors may proceed through many pages of forms to place an order; the server will have to know which was the last page completed by that user and be capable of holding information between submissions. Cookies were designed to hold information about a user, including an identifying number. When a visitor returns to a site after a few minutes or a few years the site can identify that user and serve appropriate pages.

    This is from Beginning ASP Databases by Kauffman, Spencer, and Willis (Apress, ISBN 1590592492). Check it out at your favorite bookstore today.

    Buy this book now.

    More ASP.NET Articles
    More By Apress Publishing


       · i really need help adding the updated information to my database
     

    ASP.NET ARTICLES

    - Disadvantages of the ASP.NET MVC Framework
    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT