Session Tracking in Servlet
Session Tracking in Servlet
Session is the conversion of user within span of time. In general meaning particular interval of time.
Tracking is the recording of the thing under session.
Session Tracking is remembering and recording of client conversion in span of time. It is also called as session management.
If web application is capable of remembering and recording of client conversion in span of time then that web application is called as stateful web application.
Why need Session Tracking ?
- Http protocol is stateless, to make stateful between client and server we need Session Tracking.
- Session Tracking is useful for online shopping, mailing application, E-Commerce application to track the conversion.
- Http protocol is stateless, that means each request is considered as the new request. You can see in below image.
Why use Session Tracking ?
To recognize the user It is used to recognize the particular user.
Why Http is design as stateless protocol ?
If Http is stateful protocol for multiple requests given by client to web application single connection will be used between browser and web server across the multiple requests. This may make clients to engage connection with web server for long time event though the connection are ideal. Due to this the web server reach to maximum connections even though most of its connection are idle. To overcome this problem Http is given as stateless.
Session Tracking Techniques
Servlet technology allows four technique to track conversion, they are;
- Cookies
- URL Rewriting
- Hidden Form Field
- HttpSession