Hi Folks, i am kind of new to Servlets. When you create a session to attach some information with it. It works fine but when you close the browser and try to access the session again you get a new Sessin ID and the previous one and the data associated with it is gone. I know we can save the sessionID as Cookie and retrieve it later but as per my info from Servlet API 2.1 onwards Sun deprecated "getSessionContext" method due to security reasons. Is there anyway, i can retrieve the session information (objects attached with session) that was stored at the time when i was browsing the site earlier.
I am using this code in the doGet() and doPost() method of servlet

---------------------------------------------------------

PrintWriter out = response.getWriter();
HttpSession session= request.getSession(true);
session.setMaxInactiveInterval(60*60);

Integer i= (Integer)session.getAttribute("count");

if (i==null){
i= new Integer(0);
}
else
{
        i= new Integer(i.intValue()+1);
}


session.setAttribute("count",i);
out.println(session.getId());
out.println("<BR><B>");
out.println(session.getAttribute("count"));
out.println("</B>");