• Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
  • Skip to footer

Computer Notes

Library
    • Computer Fundamental
    • Computer Memory
    • DBMS Tutorial
    • Operating System
    • Computer Networking
    • C Programming
    • C++ Programming
    • Java Programming
    • C# Programming
    • SQL Tutorial
    • Management Tutorial
    • Computer Graphics
    • Compiler Design
    • Style Sheet
    • JavaScript Tutorial
    • Html Tutorial
    • Wordpress Tutorial
    • Python Tutorial
    • PHP Tutorial
    • JSP Tutorial
    • AngularJS Tutorial
    • Data Structures
    • E Commerce Tutorial
    • Visual Basic
    • Structs2 Tutorial
    • Digital Electronics
    • Internet Terms
    • Servlet Tutorial
    • Software Engineering
    • Interviews Questions
    • Basic Terms
    • Troubleshooting
Menu

Header Right

Home » Networking » Services » HTTP Cookie – What is the HTTP cookie?
Next →
← Prev

HTTP Cookie – What is the HTTP cookie?

By Dinesh Thakur

• Cookie is a special header sent by the server to the client or browser.

• Cookie introduces session information.

• When a server receives a request from a client, it stores information about the client in the file or a string.

• This file contains the domain name of the client, a timestamp and other information in addition to cookie.

• Cookie is just a file or string and not the executable program. It contains the session-Id, path, lifetime etc.

• The server includes this cookie in the response that it sends to the client.

• When the client receives the response, the browser stores this cookie in the cookie directory.

• When a client sends a request to the same server next time, the browser looks in the cookie directory to see whether a cookie sent by that server is present or not.

• If such cookie is found, it is included in the request.

• When the server receives the request, it comes to know that it is an old client and not a new one.

• The session ID information enables the server to link the new request to the previous request.

• The various fields in cookie are:

1. Domain. This field specifies the domain name from which the cookie is coming to the browser. Each domain cannot store more than 20 cookies per client.

2. Path. It is a path in the server’s directory structure that identifies which parts of the server’s file tree may use the cookie. It is often /, which means whole tree.

3. Content. This field is where the cookie’s content is stored. It has a form name = value. Both name and value can be anything the server wants.

4. Expires. This field specifies the expiry date and time for a cookie. On the basis of expiry date and time, cookies are of two types:

(a) Non-persistent cookie. It is a type of cookie in which expiry field is not present. Such a cookie is discarded by the browser when it exits.

(b) Persistent Cookie. The cookie in which expiry field specifying the date & time is present is called persistent cookie. Such a cookie is kept by the browser until it expires.

The expiration times are specified in Greenwich Mean Time.

5. Secure. This field can be set to indicate that the browser may only return the cookie to a secure server. This feature is used in e-commerce, banking & other secure applications.

An example of cookie specifying all the above discussed fields is shown in fig.

Cookies Example

Purpose of Cookie

1. Allow access to registered clients only. Some websites allow access only to the registered clients. Such web sites send a cookie to its client when the client registers for the first time. For any repeated access, only those clients are allowed that send the appropriate cookie to the server.

2. E-commerce. An electronic store (e-commerce) can use a cookie for its client shoppers. When a client selects an .item and inserts it into a cart, a cookie that contains information about the item such as its number and unit price is sent to the browser. If the client selects a second item, the cookie is updated with the new selection information. When the client finishes shopping and wants to check-out, the last cookie is retrieved and the total charge is calculated.

3. Web portals. When a user selects his/her favorite pages, a cookie is made and sent. If the site is accessed again, the cookie is sent to the server to show what the client is looking for.

4. Advertising. A cookie is also used by advertising agency. An advertising agency can place banner ads on some main website that is often visited by users. The advertising agency supplies only a URL that gives the banner address instead of the banner itself. When the user visits the main website and clicks on the icon of an advertised corporation, a request is sent to the advertising agency. The advertising agency sends the banner for example, a GIF file in addition to a cookie with the ID of the user.

You’ll also like:

  1. What is HTTP (Hypertext Transfer Protocol)?
  2. What is Http Header?
  3. Additional Capabilities of HTTP Servlets
  4. HTTP is a Stateless Protocol
  5. HTTP COOKIES in JSP
Next →
← Prev
Like/Subscribe us for latest updates     

About Dinesh Thakur
Dinesh ThakurDinesh Thakur holds an B.C.A, MCDBA, MCSD certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps.

Dinesh Thakur is a Freelance Writer who helps different clients from all over the globe. Dinesh has written over 500+ blogs, 30+ eBooks, and 10000+ Posts for all types of clients.


For any type of query or something that you think is missing, please feel free to Contact us.


Primary Sidebar

Internet

Internet Terminology

    • Internet - Home
    • Internet - Email
    • Internet - www
    • Internet - Telnet
    • Internet - Architecture
    • Internet - FTP
    • Internet - HTTP
    • Internet - MIME
    • Internet - SMTP
    • Internet - DNS
    • Internet - POP3
    • Internet - Intranet
    • Internet - SNMP
    • Internet - BOOTP
    • Internet - TFTP
    • Internet - URL
    • Internet - NAT
    • Internet - DHCP
    • Internet - Cellular Radio
    • Internet - VSAT
    • Internet - TCP/IP Services
    • Internet - IMAP4
    • Internet - GSM Architecture
    • Internet - VOIP
    • Internet - GSM Features
    • Internet - SSL
    • Internet - Web Server
    • Internet - File Server
    • Internet - NNTP
    • Internet - UUCP
    • Internet - ADSL
    • Internet - FTP
    • Internet - NFS
    • Internet - Videoconferencing
    • Internet - Audio Compression
    • Internet - xDSL
    • Internet - ADSL Protocols
    • Internet - HTTP Cookie
    • Internet - Wireless Principles
    • Internet - X.400
    • Internet - IP Standardization
    • Internet - 4G
    • Internet - CompuServe
    • Internet - Anonymous FTP
    • Internet - File Sharing
    • Internet - WRAN
    • Internet - FQDN
    • Internet - CNAME
    • Internet - Buffering
    • Internet - Cluster Computing
    • Internet - WiMAX
    • Internet - Client/Server
    • Internet - ATM
    • Internet - DSL
    • Internet - GPRS
    • Internet - Transfer rate
    • Network - Cable Modem

Network Server Technique

    • Server - Home
    • Server - Proxy
    • Server - BBS
    • Server - B Channel
    • Server - Process
    • Server - AAL
    • Server - ISDN Features
    • Server - Multicasting
    • Server - Client/Server Benefits
    • Server - Client process
    • Server - Ad-Hoc
    • Server - ISDN Interfaces
    • Server - Guided Transmission
    • Server - SONET
    • Server - ISDN Standards
    • Server - WAP
    • Server - Broadband ISDN

Networking Encryption System

    • Security - Firewall
    • Security - Cryptography
    • Security - Firewall Architectures
    • Security - Network Security Services
    • Security - VPN
    • Security - Security Threats
    • Security - Encryption
    • Security - SHA-1
    • Security - Requirements
    • Security - Digital Signatures
    • Security - Message Authentication
    • Security - MD5
    • Security - Tunneling (VPN)
    • Security - Remote Access Security

Some Other Tutorials

  • Tutorials - QOS
  • Tutorials - CTS
  • Tutorials - LTE
  • Tutorials - CDDI
  • Tutorials - AppleTalk
  • Tutorials - EtherTalk
  • Tutorials - Flooding
  • Tutorials - Tunneling
  • Ethernet - Frame
  • Ethernet - Expansion
  • Ethernet - 10 Mbit/s
  • Ethernet - Local Loop
  • Broadband vs Baseband
  • Wi-Fi vs. Mobile Broadband
  • Optical Source
  • Implementation Wireless Technology
  • Applications of Wifi
  • Wireless Router Installation
  • Networking Your Devices
  • Type of Wi-Fi equipment
  • Multi-point Architectures
  • Frame-level Architecture
  • Circuits, Channels and Multichanneling
  • Single Bit Error Vs Burst Error

Other Links

  • Internet Terminology - PDF Version

Footer

Basic Course

  • Computer Fundamental
  • Computer Networking
  • Operating System
  • Database System
  • Computer Graphics
  • Management System
  • Software Engineering
  • Digital Electronics
  • Electronic Commerce
  • Compiler Design
  • Troubleshooting

Programming

  • Java Programming
  • Structured Query (SQL)
  • C Programming
  • C++ Programming
  • Visual Basic
  • Data Structures
  • Struts 2
  • Java Servlet
  • C# Programming
  • Basic Terms
  • Interviews

World Wide Web

  • Internet
  • Java Script
  • HTML Language
  • Cascading Style Sheet
  • Java Server Pages
  • Wordpress
  • PHP
  • Python Tutorial
  • AngularJS
  • Troubleshooting

 About Us |  Contact Us |  FAQ

Dinesh Thakur is a Technology Columinist and founder of Computer Notes.

Copyright © 2025. All Rights Reserved.

APPLY FOR ONLINE JOB IN BIGGEST CRYPTO COMPANIES
APPLY NOW