Q : In session created by server with client(browser) How
can server find that request coming is belong to new
session OR belong to session that is timeout.
Answer Posted / subhash
getSession() returns a session regardless of there's apre-
existing session.Since we always get back an HttpSession
instance back from the method,the only way to know if the
session is new is to ask the session itself:
HttpSession session=request.getsession();
if(Session.isNew())
{
out.println("A NEW SESSION");
}
else
{
out.println("WelCOme Back");
}
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How does jsp engines instantiate tag handler classes instances?
write a program in javasacript to shake the window
What are page directives?
What is the difference between jsp and php?
How can we use beans in jsp?
What are the jsp tag?
How do I run a jsp file in linux?
What is server context?
What is the difference between "JTable" and "JTGrid"? can they be used interchangeably?
What is the jspinit() method?
Explain the
What are jsp and servlets?
How can we disable el?
What is content type in jsp?
How can we forward the request from jsp page to the servlet?