Is HTTP Stateless ?

  • Thread starter Thread starter Polaris
  • Start date Start date
P

Polaris

Read a few books on ASP.NET and seems to me all of them say that HTTP is
stateless (as a result, it is a complex job to maintain the session state of
a web application ,,, blaa, blaaaa...). I just wonder if this statement is
correct? HTTP runs on top of TCP; and TCP is a connection-oriented protocol
in which each conversation (session) is established through a 3-way
handshaking and the session state is maintained by the TCP stack until the
client signals to end the conversation (in ASP.NET's web application, this
action could be the user's explicit "logout", or his session expires).

ANY thoughts on this is appreciated.

Thanks
 
Right, and the main reason for creating a tcp connection upon each request
and response is for reliability reasons... the connection is mostly used for
resending dropped packets etc.
 
Yes HTTP is stateless even if it runs on top of TCP.

A HTTP conversation essentially consists of a single request and a single
response. After that the "session" is usually gone. Two subsequent requests
from one client can come through two separate TCP connections. Web servers
do optimize things by keeping the connection alive for a while in case the
client sends another request, but basically all that HTTP sees is one
request and a response.

In order to maintain session in the web application, programmers need to
associate seemingly unrelated HTTP requests from one client somehow. In
practice this is done with cookies or storing cookie-like information in the
URL.

Sami
www.capehill.net
 
Back
Top