File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 757
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Query about session ?