Which is better approach among four(HttpSession,cookie,URL
Rewriting, Hidden Fields) Session Tracking technic's ? Why ?

Answer Posted / sridhar

Best Approaches are HttpSession and URL Rewriting.....
in HttpSession when client sends the request to the server first time session object will be created.
HttpSession ses=Request.getSession(true);//if session is not created a new session will be created and JsessionId is sent to the client.if session is already created existed Jsession Id send to the client.
HttpSession ses=Request.getSession(false);//if session is already created the Jsessionid will send to the client
if not it will not create Session object.

If browser doesn't support cookies the appln will not work properly.
So to avoid this problem We can use UrlRewriting........

Is This Answer Correct ?    17 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you create a deadlock condition on a servlet?

802


What is the difference between jsp and servlet life cycle?

963


What are the different methods of session management in servlets?

755


Explain url encoding in servlet?

811


Tell us something about servletconfig interface.

780


What do you mean by httpservlet?

771


What is difference between jsp and servlet?

907


Why do we have servlet filters?

797


What is difference between get and post method?

793


Is it possible to have a constructor inside the servlet?

753


What is the procedure for initializing a servlet?

765


What is URL Encoding?

868


How can an existing session be invalidated?

887


What are the supporting protocol by HttpServlet ?

884


How to generate the server side programming and the advantages of it over the other languages?

793