Cookies Client Identification

w

HTTP The Definitive Guide

Cookies are the best current way to identify users and allow persistent sessions. They don‘t suffer
many of the problems of the previous techniques, but they often are used in conjunction with those
techniques for extra value. Cookies were first developed by Netscape but now are supported by all
major browsers.
Because cookies are important, and they define new HTTP headers, we‘re going to explore them in
more detail than we did the previous techniques. The presence of cookies also impacts caching, and
most caches and browsers disallow caching of any cookied content. The following sections present
more details.

11.6.1 Types of Cookies
You can classify cookies broadly into two types: session cookies and persistent cookies. A session
cookie is a temporary cookie that keeps track of settings and preferences as a user navigates a site. A
session cookie is deleted when the user exits the browser. Persistent cookies can live longer; they are
stored on disk and survive browser exits and computer restarts. Persistent cookies often are used to
retain a configuration profile or login name for a site that a user visits periodically.
The only difference between session cookies and persistent cookies is when they expire. As we will
see later, a cookie is a session cookie if its Discard parameter is set, or if there is no Expires or Max-
Age parameter indicating an extended expiration time.

11.6.2 How Cookies Work
Cookies are like "Hello, My Name Is" stickers stuck onto users by servers. When a user visits a web
site, the web site can read all the stickers attached to the user by that server.
The first time the user visits a web site, the web server doesn‘t know anything about the user (Figure
11-3a). The web server expects that this same user will return again, so it wants to "slap" a unique
cookie onto the user so it can identify this user in the future. The cookie contains an arbitrary list of
name=value information, and it is attached to the user using the Set-Cookie or Set-Cookie2 HTTP
response (extension) headers.
Cookies can contain any information, but they often contain just a unique identification number,
generated by the server for tracking purposes. For example, in Figure 11-3b, the server slaps onto the
user a cookie that says id="34294". The server can use this number to look up database information
that the server accumulates for its visitors (purchase history, address information, etc.).
However, cookies are not restricted to just ID numbers. Many web servers choose to keep information
directly in the cookies. For example:
Cookie: name="Brian Totty"; phone="555-1212"
The browser remembers the cookie contents sent back from the server in Set-Cookie or Set-Cookie2
headers, storing the set of cookies in a browser cookie database (think of it like a suitcase with stickers
from various countries on it). When the user returns to the same site in the future (Figure 11-3c), the
browser will select those cookies slapped onto the user by that server and pass them back in a Cookie
request header.

Figure 11-3. Slapping a cookie onto a user

时间: 2024-10-23 23:52:50

Cookies Client Identification的相关文章

Technical analysis of client identification mechanisms

http://www.chromium.org/Home/chromium-security/client-identification-mechanisms Chromium‎ > ‎Chromium Security‎ > ‎ Technical analysis of client identification mechanisms Written by Artur Janc <[email protected]> and Michal Zalewski <[email

Cookies and Session Tracking Client Identification cookie与会话跟踪 客户端识别

w HTTP The Definitive Guide Cookies can be used to track users as they make multiple transactions to a web site. E-commerce web sites use session cookies to keep track of users' shopping carts as they browse. Let's take the example of the popular sho

Cookies, Security, and Privacy Client Identification

w HTTP The Definitive Guide Cookies themselves are not believed to be a tremendous security risk, because they can be disabled and because much of the tracking can be done through log analysis or other means. In fact, by providing a standardized, scr

Fingerprinting

https://wiki.mozilla.org/Fingerprinting Fingerprinting Contents 1 Overview 2 Data 2.1 Plugins 2.2 Fonts 2.3 User Agent 2.4 HTTP ACCEPT 2.5 Screen resolution 2.6 Timezone 2.7 Supercookies 2.8 Cookies enabled 3 Extra credit 3.1 Other data acquired via

httpclient3+jsoup获取正方教务系统课表

运用httpclient3+jsoup获取正方教务系统课表 import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.Scanner; i

Python语言和Flask框架

百科Python  : Python,是一种面向对象.直译式计算机程序设计语言:Python语法简捷而清晰,具有丰富和强大的类库.它常被昵称为胶水语言,它能够很轻松的把用其他语言制作的各种模块(尤其是C/C++)轻松地联结在一起.常见的一种应用情形是,使用python快速生成程序的原型(有时甚至是程序的最终界面),然后对其中有特别要求的部分,用更合适的语言改写,比如3D游戏中的图形渲染模块,速度要求非常高,就可以用C++重写. 基于C的Python编译出的字节码文件,通常是.pyc格式. Fla

Retrofit+OKHttp 教你怎么持久化管理Cookie

绪论 最近小编有点忙啊,项目比较紧,所以一直在忙活项目,继之前的自定义组件之后就没再写博客了,如果你没看到之前的自定义组件你可以看一下: Android自定义下拉刷新动画–仿百度外卖下拉刷新 Android自定义组合控件-教你如何自定义下拉刷新和左滑删除 效果还行,源码也已经传到我的Github上了. 那么今天小编来给大家分享点什么呢?对,就是它:Retrofit,话说Retrofit最近真的很火啊,Retrofit+OKHttp现在似乎已经成为了Android网络请求框架的主流框架了吧,小编之

DHCP的8类报文抓包以及option详解

DHCP(Dynamic Host Configuration Protocol﹐中文名为动态主机配置协议)它的前身是 BOOTP,它工作在OSI的应用层,是一种帮助计算机从指定的DHCP服务器获取它们的配置信息的自举协议. DHCP使用客户端/服务器模式,请求配置信息的计算机叫做DHCP客户端,而提供信息的叫做DHCP的服务器. DHCP为客户端分配地址的方法有三种:手工配置.自动配置.动态配置. DHCP最重要的功能就是动态分配.除了IP地址,DHCP分组还为客户端提供其他的配置信息,比如子

java HttpClient 获取页面Cookie信息

HttpClient client = new HttpClient(); GetMethod get=new GetMethod("http://www.baidu.com"); try { client.executeMethod(get); } catch (HttpException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Aut