Hi Sirisha,
I guess this is what you meant : i have tried and it is working.thnx.
public class Login extends HttpServlet
{
public void init(ServletConfig sc)throws ServletException{
super.init(sc);
}
public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException{
PrintWriter out = res.getWriter();
String userid = req.getParameter("userid");
ServletContext sctxt = getServletContext();
String uid = (String)sctxt.getAttribute("userid");
if(uid == null){
sctxt.setAttribute("userid",userid);
out.println("new userid :"+userid);
}
else if(uid.equals(userid)){
out.println("old userid : "+userid);
}
}
}
In continuation with the session management, I open browser and log into my application. After that i open another browser and try to log-in again. Will the session.isNew() return true/false when i try log-in from the different browser.