SlideShare une entreprise Scribd logo
1  sur  15
User-Server Interaction
Authentication
• Many sites require users to provide a
username and a password in order to access
the documents housed on the server.
• This requirement is referred to as
authentication.
• HTTP provides special status codes and
headers to help sites perform authentication
Suppose a client requests an object from a server, and
the server requires user authorization.
1. The client first sends an ordinary request message
with no special header lines.
2. The server then responds with empty entity body
and with a 401 Authorization Required status code.
In this response message the server includes the
WWW-Authenticate: header, which specifies the
details about how to perform authentication.
3. The client receives the response message and
prompts the user for a username and password. The
client resends the request message, but this time
includes an Authorization: header line, which
includes the username and password.
• After obtaining the first object, the client
continues to send the username and
password in subsequent requests for objects
on the server.
Cookies
• Cookies are an alternative mechanism for sites
to keep track of users.
• Suppose a client contacts a Web site for the
first time, and this site uses cookies.
• The server’s response will include a Set-
cookie: header.
• Often this header line contains an
identification number generated by the Web
server.
• For example, the header line might be:
Set-cookie: 1678453
• When the the HTTP client receives the response
message, it sees the Set-cookie: header and
identification number.
• It then appends a line to a special cookie file that is
stored in the client machine.
• This line typically includes the host name of the
server and user's associated identification number.
• In subsequent requests to the same server, say one
week later, the client includes a Cookie: request
header, and this header line specifies the
identification number for that server.
• In the current example, the request message
includes the header line:
Cookie: 1678453
Web servers use cookies for many different
purposes:
• l If a server requires authentication but doesn't
want to hassle a user with a username and
password prompt every time the user visits the
site, it can set a cookie.
• l If a server wants to remember a user's
preferences so that it can provide targeted
advertising during subsequent visits, it can set a
cookie.
• l If a user is shopping at a site the server can use
cookies to keep track of the items that the user
is purchasing.
The Conditional GET
• By storing previously retrieved objects, Web
caching can reduce object-retrieval delays and
diminish the amount of Web traffic sent over
the Internet.
• HTTP has a mechanism that allows the client
to employ caching while still ensuring that all
objects passed to the browser are up-to-date.
This mechanism is called the conditional GET.
The Conditional GET...
• An HTTP request message is a so-called
conditional GET message if
– the request message uses the GET method and
– the request message includes an If-Modified-
Since: header line.
The Conditional GET...
• First, a browser requests an uncached object
from some Web server:
GET /fruit/kiwi.gif HTTP/1.0
User-agent: Mozilla/4.0
Accept: text/html, image/gif, image/jpeg
The Conditional GET...
• Second, the Web server sends a response
message with the object to the client:
HTTP/1.0 200 OK
Date: Wed, 12 Aug 1998 15:39:29
Server: Apache/1.3.0 (Unix)
Last-Modified: Mon, 22 Jun 1998 09:23:24
Content-Type: image/gif
data data data data data ...
The Conditional GET...
• The client displays the object to the user but
also saves the object in its local cache.
• Importantly, the client also caches the last-
modified date along with the object.
• Third, one week later, the user requests the
same object and the object is still in the cache.
The Conditional GET...
• Since this object may have been modified at the
Web server in the past week, the browser
performs an up-to-date check by issuing
conditional GET. Specifically, the browser sends
GET /fruit/kiwi.gif HTTP/1.0
User-agent: Mozilla/4.0
Accept: text/html, image/gif, image/jpeg
If-modified-since: Mon, 22 Jun 1998 09:23:24
The Conditional GET...
• Note that the value of the If-modified-since:
header line is exactly equal to value of the
Last-Modified: header line that was sent by
the server one week ago.
HTTP/1.0 304 Not Modified
Date: Wed, 19 Aug 1998 15:39:29
Server: Apache/1.3.0 (Unix)
(empty entity body)
User server interaction

Contenu connexe

Tendances

Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptxAcad
 
Lecture 9 electronic_mail_representation_and_transfer
Lecture 9 electronic_mail_representation_and_transferLecture 9 electronic_mail_representation_and_transfer
Lecture 9 electronic_mail_representation_and_transferSerious_SamSoul
 
Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmpinki soni
 
Sliding window protocol(ARQ technique)
Sliding window protocol(ARQ technique)Sliding window protocol(ARQ technique)
Sliding window protocol(ARQ technique)shilpa patel
 
Distance Vector Routing
Distance Vector RoutingDistance Vector Routing
Distance Vector RoutingShouvikDhali
 
Simple mail transfer protocol (smtp)
Simple mail transfer protocol (smtp) Simple mail transfer protocol (smtp)
Simple mail transfer protocol (smtp) RochakSrivastava3
 
Aggrement protocols
Aggrement protocolsAggrement protocols
Aggrement protocolsMayank Jain
 
Framming data link layer
Framming data link layerFramming data link layer
Framming data link layerPREMAL GAJJAR
 
Sliding window
 Sliding window Sliding window
Sliding windowradhaswam
 

Tendances (20)

MAT Chapter 1
MAT Chapter 1MAT Chapter 1
MAT Chapter 1
 
Error control
Error controlError control
Error control
 
go back n protocol
go back n protocolgo back n protocol
go back n protocol
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptx
 
Lecture 9 electronic_mail_representation_and_transfer
Lecture 9 electronic_mail_representation_and_transferLecture 9 electronic_mail_representation_and_transfer
Lecture 9 electronic_mail_representation_and_transfer
 
Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithm
 
Stop and-wait protocol
Stop and-wait protocolStop and-wait protocol
Stop and-wait protocol
 
Sliding window protocol(ARQ technique)
Sliding window protocol(ARQ technique)Sliding window protocol(ARQ technique)
Sliding window protocol(ARQ technique)
 
Bus aribration
Bus aribrationBus aribration
Bus aribration
 
Distance Vector Routing
Distance Vector RoutingDistance Vector Routing
Distance Vector Routing
 
Application Layer
Application LayerApplication Layer
Application Layer
 
Flow Control
Flow ControlFlow Control
Flow Control
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
 
Simple mail transfer protocol (smtp)
Simple mail transfer protocol (smtp) Simple mail transfer protocol (smtp)
Simple mail transfer protocol (smtp)
 
Aggrement protocols
Aggrement protocolsAggrement protocols
Aggrement protocols
 
Framming data link layer
Framming data link layerFramming data link layer
Framming data link layer
 
Dhcp
DhcpDhcp
Dhcp
 
Sliding window
 Sliding window Sliding window
Sliding window
 
Dhcp ppt
Dhcp pptDhcp ppt
Dhcp ppt
 
Error control
Error controlError control
Error control
 

En vedette

User server interaction-Cookies
User server interaction-CookiesUser server interaction-Cookies
User server interaction-CookiesJoy Patel
 
Introduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and SilverlightIntroduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and SilverlightPeter Gfader
 
Asp.net server control
Asp.net  server controlAsp.net  server control
Asp.net server controlSireesh K
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and responseSahil Agarwal
 
ASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewStateASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewStateMindfire Solutions
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life CycleAbhishek Sur
 
Http request and http response
Http request and http responseHttp request and http response
Http request and http responseNuha Noor
 
HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)Gurjot Singh
 

En vedette (11)

User server interaction-Cookies
User server interaction-CookiesUser server interaction-Cookies
User server interaction-Cookies
 
HTTP
HTTPHTTP
HTTP
 
Introduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and SilverlightIntroduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and Silverlight
 
Asp.Net Control Architecture
Asp.Net Control ArchitectureAsp.Net Control Architecture
Asp.Net Control Architecture
 
Asp.net server control
Asp.net  server controlAsp.net  server control
Asp.net server control
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and response
 
ASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewStateASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewState
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
 
Http request and http response
Http request and http responseHttp request and http response
Http request and http response
 
HTTP Basics
HTTP BasicsHTTP Basics
HTTP Basics
 
HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)
 

Similaire à User server interaction

Unit-5_Application_QoS.pdfcomputer network
Unit-5_Application_QoS.pdfcomputer networkUnit-5_Application_QoS.pdfcomputer network
Unit-5_Application_QoS.pdfcomputer network4SI21CS112RakeshMS
 
BITM3730 Networking.pdf
BITM3730 Networking.pdfBITM3730 Networking.pdf
BITM3730 Networking.pdfMattMarino13
 
BITM3730 11-1.pptx
BITM3730 11-1.pptxBITM3730 11-1.pptx
BITM3730 11-1.pptxMattMarino13
 
BITM3730Week9(1).pptx
BITM3730Week9(1).pptxBITM3730Week9(1).pptx
BITM3730Week9(1).pptxMattMarino13
 
Using cookies and sessions
Using cookies and sessionsUsing cookies and sessions
Using cookies and sessionsNuha Noor
 
application of http.pptx
application of http.pptxapplication of http.pptx
application of http.pptxssuseraf60311
 
OAuth [noddyCha]
OAuth [noddyCha]OAuth [noddyCha]
OAuth [noddyCha]noddycha
 
SCWCD : Session management : CHAP : 6
SCWCD : Session management : CHAP : 6SCWCD : Session management : CHAP : 6
SCWCD : Session management : CHAP : 6Ben Abdallah Helmi
 
Difference between Client Polling vs Server Push vs Websocket vs Long Polling
Difference between Client Polling vs Server Push vs Websocket vs Long PollingDifference between Client Polling vs Server Push vs Websocket vs Long Polling
Difference between Client Polling vs Server Push vs Websocket vs Long Pollingjeetendra mandal
 
Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207Lori Head
 
Enterprise java unit-2_chapter-3
Enterprise  java unit-2_chapter-3Enterprise  java unit-2_chapter-3
Enterprise java unit-2_chapter-3sandeep54552
 
19_JavaScript - Storage_Cookies-tutorial .pptx
19_JavaScript - Storage_Cookies-tutorial .pptx19_JavaScript - Storage_Cookies-tutorial .pptx
19_JavaScript - Storage_Cookies-tutorial .pptxssuser4a97d3
 
HTTP Protocol Basic
HTTP Protocol BasicHTTP Protocol Basic
HTTP Protocol BasicChuong Mai
 
Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3Syed Ariful Islam Emon
 
Creating a Sign On with Open id connect
Creating a Sign On with Open id connectCreating a Sign On with Open id connect
Creating a Sign On with Open id connectDerek Binkley
 

Similaire à User server interaction (20)

Unit-5_Application_QoS.pdfcomputer network
Unit-5_Application_QoS.pdfcomputer networkUnit-5_Application_QoS.pdfcomputer network
Unit-5_Application_QoS.pdfcomputer network
 
BITM3730 Networking.pdf
BITM3730 Networking.pdfBITM3730 Networking.pdf
BITM3730 Networking.pdf
 
Unit v
Unit v Unit v
Unit v
 
BITM3730 11-1.pptx
BITM3730 11-1.pptxBITM3730 11-1.pptx
BITM3730 11-1.pptx
 
BITM3730Week9(1).pptx
BITM3730Week9(1).pptxBITM3730Week9(1).pptx
BITM3730Week9(1).pptx
 
Using cookies and sessions
Using cookies and sessionsUsing cookies and sessions
Using cookies and sessions
 
application of http.pptx
application of http.pptxapplication of http.pptx
application of http.pptx
 
OAuth [noddyCha]
OAuth [noddyCha]OAuth [noddyCha]
OAuth [noddyCha]
 
SCWCD : Session management : CHAP : 6
SCWCD : Session management : CHAP : 6SCWCD : Session management : CHAP : 6
SCWCD : Session management : CHAP : 6
 
Module5SADP.pptx
Module5SADP.pptxModule5SADP.pptx
Module5SADP.pptx
 
Http-protocol
Http-protocolHttp-protocol
Http-protocol
 
Difference between Client Polling vs Server Push vs Websocket vs Long Polling
Difference between Client Polling vs Server Push vs Websocket vs Long PollingDifference between Client Polling vs Server Push vs Websocket vs Long Polling
Difference between Client Polling vs Server Push vs Websocket vs Long Polling
 
SCWCD : The web client model
SCWCD : The web client modelSCWCD : The web client model
SCWCD : The web client model
 
Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207
 
http presentation 1.pptx
http presentation 1.pptxhttp presentation 1.pptx
http presentation 1.pptx
 
Enterprise java unit-2_chapter-3
Enterprise  java unit-2_chapter-3Enterprise  java unit-2_chapter-3
Enterprise java unit-2_chapter-3
 
19_JavaScript - Storage_Cookies-tutorial .pptx
19_JavaScript - Storage_Cookies-tutorial .pptx19_JavaScript - Storage_Cookies-tutorial .pptx
19_JavaScript - Storage_Cookies-tutorial .pptx
 
HTTP Protocol Basic
HTTP Protocol BasicHTTP Protocol Basic
HTTP Protocol Basic
 
Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3
 
Creating a Sign On with Open id connect
Creating a Sign On with Open id connectCreating a Sign On with Open id connect
Creating a Sign On with Open id connect
 

Plus de bhavanatmithun

Plus de bhavanatmithun (12)

Code optimisation presnted
Code optimisation presntedCode optimisation presnted
Code optimisation presnted
 
computer networks
computer networkscomputer networks
computer networks
 
Deadlock
DeadlockDeadlock
Deadlock
 
krisibhavan site
krisibhavan sitekrisibhavan site
krisibhavan site
 
Types of cn, protocols and standards
Types of cn, protocols and standardsTypes of cn, protocols and standards
Types of cn, protocols and standards
 
Snmp
SnmpSnmp
Snmp
 
Iso osi and tcp-ip reference models
Iso osi and tcp-ip reference modelsIso osi and tcp-ip reference models
Iso osi and tcp-ip reference models
 
FTP
FTPFTP
FTP
 
DNS
DNSDNS
DNS
 
application layer protocols
application layer protocolsapplication layer protocols
application layer protocols
 
Group communication
Group communicationGroup communication
Group communication
 
Group communication
Group communicationGroup communication
Group communication
 

Dernier

Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 

Dernier (20)

Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

User server interaction

  • 2. Authentication • Many sites require users to provide a username and a password in order to access the documents housed on the server. • This requirement is referred to as authentication. • HTTP provides special status codes and headers to help sites perform authentication
  • 3. Suppose a client requests an object from a server, and the server requires user authorization. 1. The client first sends an ordinary request message with no special header lines. 2. The server then responds with empty entity body and with a 401 Authorization Required status code. In this response message the server includes the WWW-Authenticate: header, which specifies the details about how to perform authentication. 3. The client receives the response message and prompts the user for a username and password. The client resends the request message, but this time includes an Authorization: header line, which includes the username and password.
  • 4. • After obtaining the first object, the client continues to send the username and password in subsequent requests for objects on the server.
  • 5. Cookies • Cookies are an alternative mechanism for sites to keep track of users. • Suppose a client contacts a Web site for the first time, and this site uses cookies. • The server’s response will include a Set- cookie: header. • Often this header line contains an identification number generated by the Web server. • For example, the header line might be: Set-cookie: 1678453
  • 6. • When the the HTTP client receives the response message, it sees the Set-cookie: header and identification number. • It then appends a line to a special cookie file that is stored in the client machine. • This line typically includes the host name of the server and user's associated identification number. • In subsequent requests to the same server, say one week later, the client includes a Cookie: request header, and this header line specifies the identification number for that server. • In the current example, the request message includes the header line: Cookie: 1678453
  • 7. Web servers use cookies for many different purposes: • l If a server requires authentication but doesn't want to hassle a user with a username and password prompt every time the user visits the site, it can set a cookie. • l If a server wants to remember a user's preferences so that it can provide targeted advertising during subsequent visits, it can set a cookie. • l If a user is shopping at a site the server can use cookies to keep track of the items that the user is purchasing.
  • 8. The Conditional GET • By storing previously retrieved objects, Web caching can reduce object-retrieval delays and diminish the amount of Web traffic sent over the Internet. • HTTP has a mechanism that allows the client to employ caching while still ensuring that all objects passed to the browser are up-to-date. This mechanism is called the conditional GET.
  • 9. The Conditional GET... • An HTTP request message is a so-called conditional GET message if – the request message uses the GET method and – the request message includes an If-Modified- Since: header line.
  • 10. The Conditional GET... • First, a browser requests an uncached object from some Web server: GET /fruit/kiwi.gif HTTP/1.0 User-agent: Mozilla/4.0 Accept: text/html, image/gif, image/jpeg
  • 11. The Conditional GET... • Second, the Web server sends a response message with the object to the client: HTTP/1.0 200 OK Date: Wed, 12 Aug 1998 15:39:29 Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 09:23:24 Content-Type: image/gif data data data data data ...
  • 12. The Conditional GET... • The client displays the object to the user but also saves the object in its local cache. • Importantly, the client also caches the last- modified date along with the object. • Third, one week later, the user requests the same object and the object is still in the cache.
  • 13. The Conditional GET... • Since this object may have been modified at the Web server in the past week, the browser performs an up-to-date check by issuing conditional GET. Specifically, the browser sends GET /fruit/kiwi.gif HTTP/1.0 User-agent: Mozilla/4.0 Accept: text/html, image/gif, image/jpeg If-modified-since: Mon, 22 Jun 1998 09:23:24
  • 14. The Conditional GET... • Note that the value of the If-modified-since: header line is exactly equal to value of the Last-Modified: header line that was sent by the server one week ago. HTTP/1.0 304 Not Modified Date: Wed, 19 Aug 1998 15:39:29 Server: Apache/1.3.0 (Unix) (empty entity body)