Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is tld in jsp?

1002


What is use of scriptlet tags in jsp?

897


What is session object in jsp?

1097


Explain the various scope values for tag.

904


How do I mix jsp and ssi #include?

997


difference betwwn 16 bit and 32 bit

2110


What is jsp-config in deployment descriptor?

1014


Explain the uses of tag.

911


How does el search for an attribute?

895


Is there a way to reference the "this" variable within a jsp page?

1046


Explain implicit objects in jsp?

1063


How we can include the result of another page in jsp?

917


Define JSP Scriptlet.

976


Can we use the exception implicit object in any jsp page?

886


Why is it that JComponent have add() and remove() methods but Component doesn’t?

956