File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Session tracking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session tracking" Watch "Session tracking" New topic
Author

Session tracking

Anuj Anand
Ranch Hand

Joined: Nov 18, 2000
Posts: 96
What is URL rewriting and how is it implemented?? Also how is seesion tracking done with the help of persistent cookies??
Preethi Suryam
Ranch Hand

Joined: Nov 17, 2000
Posts: 92
Hi Anju!
U use URL Rewriting,
If the user's browser does not support cookies and the user clicks on an un-rewritten URL, the user's session is lost. The servlet contacted through that link creates a new session, but the new session does not have the data associated with the previous session. Once a servlet loses the session data, the data is lost for all servlets that share the session. You should consistently use URL rewriting if your servlet is to support clients that do not support or accept cookies.

I will give a brief view of Session Tracking using cookies!
1. create a cookie- Cookie mycookie=new Cookie("name",value)
2. Cookies are sent as headers of the response to the client they are added with the addCookie method of the HttpServletResponse class
res.addCookie(mycookie);
3.Retrieving cookie
req.getCookies();
4.Getting value of cookie
mycookie.getValue();
Hope u find this information useful
Have a Nice Day!
Preethi

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session tracking