150 likes | 317 Views
Client Identification and Cookies. Herng-Yow Chen. HTTP headers that carry information about user identification Client IP addressing tracking User login, using authentication to identify users Fat URLs, a technique for embedding identify in URLs
E N D
Client Identification and Cookies Herng-Yow Chen
HTTP headers that carry information about user identification Client IP addressing tracking User login, using authentication to identify users Fat URLs, a technique for embedding identify in URLs Cookies, a technique for maintaining persistent state Outline
Client IP Address Proxy server client server 56.41.11.4 209.172.34.56 Client-ip:56.41.11.4 X-Forwarded-For:209.172.34.56
User Login GET /index.html HTTP/1.0 Host: www.joes-hardware.com (a) Internet server client (b) HTTP/1.0 401 Login Required WWW-authenticate: Basic realm="Plumbing and Fixtures" Internet server client
User Login GET /index.html HTTP/1.0 Host: www.joes-hardware.com Authorization: Basic am910jrmdw4= (c) Internet server client (d) HTTP/1.0 200 OK Content-length: 4342 Content-type: text/html … Internet server client
Cookie Jar: Client-Side State (a) GET /index.html HTTP/1.0 Host: www.ncnu.edu.tw Internet server client HTTP/1.0 200 OK Set-cookie: id=“34294”; domain=“www.ncnu.edu.tw” Content-type: text/html Content-length: 1903 … (b) Internet Id=34294 client Set-Cookie server (c) GET /index.html HTTP/1.0 Host: www.ncnu.edu.tw Cookie: id=“34294” Cookie Internet Id=34294 client server
Different Cookies for Different Sites Can open MISE cookies in A text viewer program Name=“session-id-time“ Value=“1068624000” Domain/path=“amazon.com” Proprietary format for Other attributes Coookie Each cookie file has cookies For a particular site;the cookies Are stored in text lines,one after The other Coookie
MAME=VALUE Expires Domain Path Secure Version 0 Set-Cookie header
NAME=VALUE Version Comment CommentURL Discard Domain Max-Age Path Port Secure Version1(RFC 2965) Set-Cookie2 attributes
Cookies and Caching client server (a) GET / HTTP/1.0 Host: www.amazon.com (b) Http/1.1 302 Found Location: http://www.amazon.com:80/exc/obidos/subst/home/redirect.html (c) GET /exc/obidos/subst/home/redirect.html HTTP/1.0 Host: www.amazon.com HTTP/1.1 302 Found Date: Wed, 05 Nov 2003 14:05:19 GMT Set-Cookie: session-id=103-6021036-0351066; Path=/; Domain=.amazon.com; expires=Sunday, 10-Nov-2003 20:00:00 GMT Set-Cookie: session-id-time=1068624000; Path=/; Domain=.amazon.com; expires=Sunday, 10-Nov-2003 20:00:00 GMT (d)
Cookies and Caching client server GET /exc/obidos/subst/home/redirect.html/103-6021036-0351066 HTTP/1.0 Host: www.amazon.com Cookie: session-id=103-6021036-0351066; session-id-time=1068624000 (e) HTTP/1.1 302 Found Date: Wed, 05 Nov 2003 14:30:55 GMT Set-Cookie: ubid-main=430-2474191-8563948; Path=/; Domain=.amazon.com; expires=Tuesday, 10-Nov-2035 20:00:01 GMT Set-Cookie: x-main="hQ...bf"; Path=/; Domain=.amazon.com; expires=Tuesday, 10-Nov-2035 20:00:01 GMT Location: http://www.amazon.com/exec/obidos/subst/home/home.html/103-6021036-0351066 (f)
Cookies and Caching client server GET /exc/obidos/subst/home/redirect.html/103-6021036-0351066 HTTP/1.0 Host: www.amazon.com Cookie: session-id=103-6021036-0351066; session-id-time=1068624000; ubid-main=430-2474191-8563948; x-main="hQ...bf" (g) (h)
Cookies Simon St.Laurent,McGraw-Hill http://www.ietf.org/rfc/rfc2965.txt HTTP State Management Mechanism http://www.ietf.org/rfc/rfc2964.txt Use of HTTP State Management http://home.netscape.com/newsref/std/cookie_spec.html “PERSISTENT CLIENT STATE:HTTP COOKIES“ For More Information