1
play

1 Cookies Cookie crumbs HTTP is stateless: doesn't remember from - PDF document

(World Wide) Web HTTP: Hypertext transfer protocol a way to connect computers that provide information (servers) What happens when you click on a URL? with computers that ask for it (clients like you and me) client opens TCP/IP


  1. (World Wide) Web HTTP: Hypertext transfer protocol • a way to connect computers that provide information (servers) • What happens when you click on a URL? with computers that ask for it (clients like you and me) • client opens TCP/IP connection to host, sends request – uses the Internet, but it's not the same as the Internet GET /filename HTTP/1.0 GET url • server returns • URL (uniform resource locator, e.g., http://www.amazon.com) server – header info client – a way to specify what information to find, and where – HTML HTML • HTTP (hypertext transfer protocol) – a way to request specific information from a server and get it back • since server returns the text, it can be created as needed • HTML (hyptertext markup language) – can contain encoded material of many different types (MIME) – a language for describing information for display • URL format • browser (Firefox, Safari, Internet Explorer, Opera, Chrome, …) service://hostname/filename?other_stuff – a program for making requests, and displaying results • filename?other_stuff part can encode – data values from client (forms) • embellishments – request to run a program on server (cgi-bin) – pictures, sounds, movies, ... – anything else – loadable software e.g. http://www.google.com/search?q=mime &ie=utf-8&oe=utf-8&aq=t& • the set of everything this provides rls=org.mozilla:en-US:official&client=firefox-a Embellishments Forms and CGI programs • original design of HTTP just returns text to be displayed • "common gateway interface" • now includes pictures, sound, video, ... – standard way to request the server to run a program – using information provided by the client via a form – need helpers or plug-ins to display non-text content e.g., GIF, JPEG graphics; sound; movies • if the target file on server is an executable program • forms filled in by user – e.g., in /cgi-bin directory – need a program on the server to interpret the information (cgi-bin) • or if it has the right kind of name • HTTP is stateless – e.g., something.cgi • run it on the server to produce HTML to send back to client – server doesn't remember anything from one request to next – need a way to remember information on the client: cookies – using the contents of the form as input – output depends on client request: created on the fly, not just a file • active content: download code to run on the client – Javascript and other interpreters • CGI programs can be written in any programming language – Java applets – often Perl, PHP, Java – plug-ins – ActiveX Example CGI program in Perl (mailform.cgi modified) Web pages: Information passed and actions initiated • HTTP requests identify host and address: #!/usr/local/bin/perl –w use CGI; – my $urcomp = $query->remote_host(); my $query = new CGI; – my $urIP = $query->remote_addr(); print $query->header; print $query->start_html(-title=>'Form results'); • Initate actions with Javascript print "<h1> Form results </h1>\n"; – onmouseover etc my $urcomp = $query->remote_host(); my $urIP = $query->remote_addr(); • Links with “extra” print "<P> Your computer is $urcomp\n"; – Google ads print "<P> Your IP address is $urIP\n"; print "<P>\n"; foreach $name ($query->param) { print "<br> $name:"; foreach $value ($query->param($name)) { print " $value”;} print "\n"; } 1

  2. Cookies Cookie crumbs • HTTP is stateless: doesn't remember from one request to next • get a page from xyz.com – it contains <img src=http://doubleclick.com/advt.gif> • cookies intended to deal with stateless nature of HTTP – this causes a page to be fetched from DoubleClick.com – remember preferences, manage "shopping cart", etc. – which now knows your IP address and what page you were looking at • cookie: one line of text sent by server to be stored on client • DoubleClick sends back a suitable advertisement – stored in browser while it is running (transient) – with a cookie that identifies "you" at DoubleClick – stored in client file system when browser terminates (persistent) • next time you get any page that contains a doubleclick.com image • when client reconnects to same domain, – the last DoubleClick cookie is sent back to DoubleClick browser sends the cookie back to the server – the set of sites and images that you are viewing is used to – sent back verbatim; nothing added - update the record of where you have been and what you have looked at - send back targeted advertising (and a new cookie) – sent back only to the same domain that sent it originally • this does not necessarily identify you personally so far – contains no information that didn't originate with the server • but if you ever provide personal identification, it can be (and will be) attached • in principle, pretty benign • defenses: • but heavily used to monitor browsing habits, for commercial – turn off all cookies; turn off "third-party" cookies purposes – don't reveal information – clean up cookies regularly Cookie crumbs (2) Cookie crumbs (3) • modern versions are very dynamic • other kinds of tracking tools – e.g., Yahoo Right Media, Doubleclick Ad Exchange, ... • person requests a web page • web bugs, web beacons, single-pixel gifs • web page publisher notifies exchange that space on that page is – tiny image that reports the use of a particular page available – these can be used in mail messages, not just browsers – might also include information about the person, like – past online activity, viewing and shopping habits, geographical location, • Flash cookies ("local shared object") demographics, maybe even actual identity – cookie-like mechanism used by Flash • advertisers bid on the ad space – Save up to 100KB vs 4KB regular cookies – amount depends on person's attributes and location, ad budget, etc. – Must go to their site to control (lab 8) • winner's advertisement inserted into the page – Going to their site gives them info about you – Set allowed disk space to 0 for specific domain • elapsed time: 10-100 milliseconds? still allows empty directory with domain name (Wikipedia) Plugins Active X (Microsoft) • programs that extend browser, mailer, etc. • write programs in any language (C, C++, Visual Basic, ...) – browser provides API, protocol for data exchange • compile into machine instructions for PC – extension focuses on specific application area • when a web page that uses an ActiveX object is accessed – e.g., documents, pictures, sound, movies, scripting language, ... – browser downloads compiled native machine instructions – may exist standalone as well as in plugin form – checks that they are properly signed ("authenticated") by creator – Acrobat, Flash, Quicktime, RealPlayer, Windows Media Player, ... – runs them • scripting languages interpret downloaded programs • each ActiveX object comes with digital certificate from supplier – Javascript – can't be forged – Java – run the program if you trust the supplier compiled into instructions for a virtual machine • more efficient than an interpreter (like toy machine on steroids) • no restrictions on what an ActiveX object can do instructions are interpreted by virtual machine in browser – no assurance that it works properly! • the most risky of the active-content models 2

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend