MY mENU


Tuesday 6 March 2012

Session in Servlets

Session:
HTTP is a protocol which does not maintain the state of the client. It is state-less protocol, to make the protocol stateful we need to provide the session handling mechanism. This will be provided as per the need of the Application.The basic categories are 4 ways:
1. Using Cookies
2. Using Session API in Servlets
3. Using Hidden form fields
4. URL Rewriting.
The best one is using Session objects with help of Session API. Cookies are harmful because they are allowed to store on to the client machine. This way you can send a virus file as cookie So normally The system admin disables them to protect their network. The session API allows us to create SessionID and set for the client. per Client you can have one session object which will run in the Server.

No comments:

Post a Comment