Server Administration
  Home arrow Server Administration arrow HTTP State Management with Cookies
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
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? 
SERVER ADMINISTRATION

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

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

  • 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


    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


     

    SERVER ADMINISTRATION ARTICLES

    - 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
    - Squid, the Caching Proxy
    - Regular Expressions in the Unix Shell
    - Source Code Version Control Solutions
    - OTRS: Open Source Ticket Request System
    - Clonezilla: Free Mass Disk-Cloning Utility
    - Bugzilla: Open Source Bug-Tracking System
    - IT Inventory and Resource Management on Ster...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    Stay green...Green IT