to avoid http state less protocol we use sessions. earlier hidden fields &cookies are used. but using this large amount of data is transfer from browser& server.Using session.setAttribute() we pass attribute to session.
Actually HTTP is a stateless protocol so we make our web application statefull using session. Session is a mechanism through which a web container provides a particular instance to a series of request thats are all coming from the same client. In a session outcomes depends upon accumulating the current request and the previous request.
Session is an object of method maintaining state which is act of preserving the information from one page to another page. we can manage sessions in two ways using cookies using URL rewriting