What is session ?how to manage the session?

Showing Answers 1 - 6 of 6 Answers

satheesh

  • Feb 10th, 2006
 

Session is used to track users interaction with serverHttpSession,cookies,urlrewriting,hiddenfields are used to manage sessions

  Was this answer useful?  Yes

Satrajit Chatterjee

  • Feb 15th, 2006
 

Method 1) By URL rewriting

Method 2) Using Session object

Getting Session form HttpServletRequest object
HttpSession session = request.getSession(true);

Get a Value from the session
session.getValue(session.getId());

Adding values to session
cart = new Cart();
session.putValue(session.getId(), cart);


At the end of the session, we can inactivate the session by using the following command
session.invalidate();

Method 3) Using cookies

Method 4) Using hidden fields

bharat kumar.k

  • Mar 8th, 2006
 

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.

wamiq ahmad

  • Mar 23rd, 2006
 

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.

  Was this answer useful?  Yes

bhanulee

  • Apr 3rd, 2006
 

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

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions