17 October 2010
0 HTTP Session Tracking Java
Importance of Session Tracking
HTTP protocol is Stateless protocol
In HTTP protocol, Web servers and web browsers will transfer hypertext and images (sometimes files like swf etc also).When a client (Web browser) makes a request for a page or a file, the web server locates it and send back the requested file. Once the web server sends the requested file back to the web browser, there ends the connection. No session or state is maintained between the client and server, Otherwise it would increase the overheads of keeping a lot of sessions alive between the client and the server that would pose a serious performance issue. While this model scores from a performance viewpoint, it becomes a severe constraint when designing applications for the Web.
Importance of Session Tracking
Consider a client browser downloads a page from a server, and then subsequently clicks on a hyperlink on the page to connect to another related page as part of the workflow of an application. In this case, the server has no way of knowing that it is the same client who now wants to access another related page as part of the work-flow of the same application. User-specific data on the first page is something that the server will not be able to relate to the subsequent page, because as far as the server is concerned, it is a fresh hit even though the same user or client has made a hit to another subsequent page as part of the workflow of the application. The server is therefore, not able to maintain state (user or client specific data between accesses by the same client to different pages of an application.This problem can be overcome if a session is kept alive between a client and a server. For example, consider a typical scenario of a client application connecting to a database server. Once the client connects to a database, a session is established between the client and the database server. The client can invoke a stored procedure as part of its application logic. The call to the stored procedure can return data to the client that can be conditionally evaluated and different branches of execution can be initiated as part of continuing with the same application.
The Hypertext Transfer Protocol (HTTP) is by design a stateless protocol. To build effective Web applications, it is imperative that a series of different requests from a particular client can be associated with each other. Many strategies for session tracking have evolved over time, but all are difficult or troublesome for the programmer to use directly. State maintenance and session tracking became serious bottlenecks for designing effective Web-based applications. The cookie evolved as a solution to the problem of state maintenance and session tracking.
Subscribe to:
Post Comments (Atom)
0 comments:
Please give your valuable comments.