Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is use of session tracking ?with example?

Answer Posted / sivasubramanian.k

Session Tracking is one of the most powerful features of
Servlets and JSP. Basically, the servlet engine takes care
of using Cookies in the right way to preserve state across
successive requests by the same user. Your servlet just
needs to call a single method (getSession) and it has
access to a persistent hashtable of data that's unique to
the current user

public void doPost(HttpServletRequest request,
HttpServletResponse response){
...
//lets take the session obj
HttpSession session = request.getSession(true);
//now let us take the user name assosiated with this session
String currUserLogin = (String) session.getAttribute
("currentUserLogin")
...
//now we do the work according to the user name
doSomeWork(currUserLogin);
...

}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many bits is a string?

987


How is abstraction implemented in java ?

989


What class allows you to read objects directly from a stream?

1318


What is the method overriding?

1082


Does java allow overriding static methods ?

1109


Explain the differences between static and dynamic variables?

1141


What are the main differences between the java platform and other platforms?

1047


What is the purpose of checked and unchecked exceptions in JAVA?

1003


What carriage return means?

958


How do you override a private method in java?

972


How big is a 64 bit float?

1024


What are decalarations?

1116


What is meant by anonymous class?

1017


Is there a way to increase the size of an array after its declaration?

1041


What is the difference between conversation & casting?

1038