hi,
Please guide what is meaning by Web is stateless in simple words ?
Kindly also explain what is meaning by HTTP is stateless protocol ?
thanks
hi,
Please guide what is meaning by Web is stateless in simple words ?
Kindly also explain what is meaning by HTTP is stateless protocol ?
thanks
When you write a rich client application, you can store state arbitrarily at your convenience. In the web, the client is not obligated to pass any information that you can use to retain permanent information, so your web server is potentially in a permanent state of amnesia. Every time your client asks for another page, you can only use clues or hints that it's the same person talking to you.
To simulate state, you have to use cookies (or certain authentication mechanisms), combined with server-side mechanisms for associating those cookies with actual per-user data. You also can't reliably trust the cookie, so you have to make tradeoffs to determine how reliable that association is. Also, a side effect is that you never really know when an user is "done" with your session, so you can't rely on return trips to do things like close out database connections. Essentially, you have to make all important decisions about an interaction on each request, then assume the user is never coming back.
Stateless meaning:
It does not keep track of configuration settings, transaction information or any other data for the next session. When a program "does not maintain state" (is stateless) or when the infrastructure of a system prevents a program from maintaining state, it cannot take information about the last session into the next, such as settings the user chose or conditions that arose during processing.
HTTP:
The HTTP protocol, which is the communications vehicle for Web transactions, is stateless. After a Web page is delivered to the user, the connection is closed. Counter measures, such as the use of cookies, have been developed to maintain the state of a user moving from page to page on a Web site.
OR it can be simple web definition:
A protocol is stateless if there is no relation between subsequent request-response pairs. The server can handle each request uniquely and does not have to keep a session state for the client.
One way to understand HTTP and problems around sharing state between client and server is by "tampering" data from the communication between web browser and web site. This firefox plugin is just great for doing this. You can see that by sending a request from your browser, your client only says something about some basic set of parameters of your request. That is not enough for the server to know what happened in the past (= state) on the client side. Some way to pass the browser some information on your state is by using cookies, that is just some information in variables that gets attached to your request as you can also see with the tamperdata plugin.