GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE  >  Servlets
Go To First  |  Previous Question  |  Next Question 
 Servlets  |  Question 83 of 170    Print  
what is session ?how to manage the session?

  
Total Answers and Comments: 5 Last Update: April 03, 2006     Asked by: karthik 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
February 10, 2006 03:06:59   
satheesh        

RE: what is session ?how to manage the session?
Session is used to track users interaction with serverHttpSession cookies urlrewriting hiddenfields are used to manage sessions
 
Is this answer useful? Yes | No
February 15, 2006 23:58:35   
Satrajit Chatterjee        

How to manage the session?
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

 
Is this answer useful? Yes | No
March 08, 2006 06:45:06   
bharat kumar.k        

RE: what is session ?how to manage the session?
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.
 
Is this answer useful? Yes | No
March 23, 2006 07:12:25   
wamiq ahmad        

RE: what is session ?how to manage the 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.
 
Is this answer useful? Yes | No
April 03, 2006 01:48:34   
bhanulee Member Since: April 2006   Contribution: 1    

RE: what is session ?how to manage the session?
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
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape