File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Session " Watch "Session " New topic


deepa raj
Ranch Hand

Joined: Jul 25, 2008
Posts: 124
Application is using cookies for session tracking.means cookies are enabled.

in this case Whether the session will be destroyed when we close the browser?

because when we close the browser cookies will be destroyed.

session object will be there in the container server-side but not in the client side.

am i correct?
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Originally posted by deepa raj:

when we close the browser cookies will be destroyed.

i think cookies will store into your system

check the path C:\Documents and Settings\yourname\cookies

correct me,if i am wrong
deepa raj
Ranch Hand

Joined: Jul 25, 2008
Posts: 124
hi seetharaman,

from HFSJ

i am reading the concepts only.. :-)
arun nohwar

Joined: Aug 05, 2008
Posts: 16
Cookies will definitely remain in the system, even if we close the browser.
The path to cookies is as mentioned by venky above.
In Internet explorer >> Tools >> Internet Options >> General Tab,
there is a Delete Cookies button, that will delete the cookies stored in system.
The closing of the browser does not trigger the deletion of cookies.
Hema Nandhini
Ranch Hand

Joined: Aug 04, 2008
Posts: 31
To add more details, if we are creating a cookie ourself, we can set the expiration time for that cookie using Cookie.setMaxAge(int). Setting the MaxAge as -1 will make the cookie to expire immediately when the browser is closed. Check this out for better understanding:

SCJP 1.4 (86%)<br />SCWCD 1.5 (88%)
I agree. Here's the link:
subject: Session
It's not a secret anymore!