*
The moose likes Servlets and the fly likes Query about session ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Query about session ?" Watch "Query about session ?" New topic
Author

Query about session ?

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 755
What is session (Java)?
Will session get expired when user open a new window(Browser) ?
Will session get expired when user open a new window by clicking on file >> New Window ?

Want to know everything about session... including some defination...

Can anybody explain about it or send me some link ???


Jigar Naik


Srikkanth Mohanasundaram
Ranch Hand

Joined: Feb 07, 2007
Posts: 185
Hi,
You need a session when you need to maintain the conversational state of the Client across multiple requests.You can create a HttpSession object for every clent accessing your application,and put some Conversational information as attributes in the session.

Regarding timeout the behavior can be provided by you declaratively(in web.xml) or you can use HttpSession APi methods(for example HttpSession.setMaxInactiveInterval(second))

Thanks,
Srikkanth.M
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by Jigar Naik:
What is session (Java)?
Will session get expired when user open a new window(Browser) ?
Will session get expired when user open a new window by clicking on file >> New Window ?

Want to know everything about session... including some defination...



Core java do not have anything like session , but there is HTTPSession.

HTTPSession has nothing to do with browser close and opening a new window.

Servlet specification has complete description of HTTPSession.


Rahul Bhattacharjee
LinkedIn - Blog
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Jigar Naik:
...
Want to know everything about session... including some defination...
Can anybody explain about it or send me some link ???


There is a link to the Servlet Spec in my signature.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
jQuery in Action, 2nd edition
 
subject: Query about session ?