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 the jsp?

917


What are directives in jsp?

917


How we can use javascript with jsp pages?

936


What is jsp expression language and what are it’s benefits?

1086


Explain translation phase.

824


How do you comment out in jsp?

945


what is the extended star schema

2685


Why do we need custom tags in jsp?

838


Explain the uses of tag.

863


What are the differences between get and load methods?

905


How can we stop errors on display in a jsp page?

861


Can I stop jsp execution while in the midst of processing a request?

898


How can I prevent direct access to a jsp page from a browser?

847


What is the default value of session attribute in jsp?

818


How can I prevent the output of my jsp or servlet pages from being cached by the browser?

984