Server Administration

  Home arrow Server Administration arrow HTTP State Management with Cookies
SERVER ADMINISTRATION

HTTP State Management with Cookies
By: Bruce Coker
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2008-08-27

    Table of Contents:
  • HTTP State Management with Cookies
  • Cookie structure
  • Implementation
  • Cookies and PHP
  • Web Server Cookie Support

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    HTTP State Management with Cookies


    (Page 1 of 5 )

    Cookies can tell you all sorts of interesting things about your visitors. This article explains what they are, how they're structured, why they're useful, and how to implement them on your web site. Code samples are included.

    Overview

    One of the challenges facing developers of complex web applications has been overcoming the limitations of HTTP, and in particular the stateless nature of the protocol. This means that from the web server's perspective, it treats each transaction between it and a specific client as a unique event, with no continuity from one to the next.

    Back in the early days, when the web was essentially a content delivery system, this wasn't too much of a problem. Web servers could process each transaction in turn, delivering the requested content without knowing or caring from where the requests originated. However, with the demand for more complex and secure web transactions to meet the requirements of, for example, ecommerce and social networking, this situation needed to be addressed.

    To facilitate a transaction such as making an online purchase, some method is needed by which web servers can at least simulate continuity between one transaction and the next. One possible approach is to handle this on the server side. In many cases this is a desirable way of handling things. But methods have also been devised for handling things on the client side, the most common of which is the cookie.

    In essence, a cookie is a small text file that is downloaded from the web server to the client (usually a browser). Each time the client makes a new request to that server it returns the cookie unmodified, thus providing the server with information about the client.

    Typically, a cookie will contain a single piece of simple information, such as the user's identity, or a password hash. However, there have been privacy concerns over cookies since the information they contain is essentially arbitrary and chose by the web developer. This means they can also be used for darker purposes such as tracking and reporting on surfing behavior. This puts an obligation on web developers to implement cookies transparently, and in a responsible and respectful manner.

    More Server Administration Articles
    More By Bruce Coker

    blog comments powered by Disqus

    SERVER ADMINISTRATION ARTICLES

    - Server Responses to Client Communication
    - Authentication in Client/Server Communication
    - Client/Server Communication
    - Understanding Awk in the UNIX Shell
    - Stream Editor in the UNIX Shell
    - Processes in the UNIX Shell
    - Migrating from Windows to Wine
    - Wine: Not Another Emulator
    - Preventive Measures to Block SSH Attacks
    - Monitoring Temperatures with Cacti
    - Cacti: RRDTool-based Graphing Solution
    - Network Magic 5.0 Review
    - Netfilter and Iptables Overview
    - Installing and Configuring Squid
    - Clickfree PC Backup Systems Compared


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 11 - Follow our Sitemap