aspose file tools*
The moose likes Servlets and the fly likes does session remain alive even if i shuts down the server in tomcat? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "does session remain alive even if i shuts down the server in tomcat?" Watch "does session remain alive even if i shuts down the server in tomcat?" New topic
Author

does session remain alive even if i shuts down the server in tomcat?

Santosh Jagtap
Greenhorn

Joined: Sep 20, 2004
Posts: 23
i started the server and hit the url for myfile so a new session got created.
now i shut down the server (not the browser).
and started it again .and refreshed the page.
then in this case will i get new session id or the same id will be continued (which was assigned to me at first time) in tomcat?


Santy
Neeraj Vij
Ranch Hand

Joined: Nov 25, 2003
Posts: 315
unless you have save your state in some secondary storage...server will start a new session.

cheers!!
Neeraj.
Santosh Jagtap
Greenhorn

Joined: Sep 20, 2004
Posts: 23
Originally posted by Neeraj Vij:
unless you have save your state in some secondary storage...server will start a new session.

cheers!!
Neeraj.


yeah thts true if i haven't persisted my session object i wont get the same object but its happening
what i did is
i created 3 jsp pages
1 - containing 2 buttons one for setsession attr and another for getsession attr
2 - for sesetting session attribute by name "myName" value is "Santy"
3 - for getting and printing session attribute "myName"

i hitted the url for the first jsp and clicked on set session button the second file get called and the attribute is stored in session by name myname with value "Santy"
then i pressed back button and clicked on get button ,the third file get called and printed "Santy"
then again i clicked on back button

now i restarted the server refreshed the first jsp and called directly third file .even then i got the output as "Santy"
Neeraj Vij
Ranch Hand

Joined: Nov 25, 2003
Posts: 315
Hi,

humm...

Just for my help..

1.)before restarting the server clear the browser history and delete all temp. internet files which contains cookies too.
2.)then try to get the seesion variable value.


rgds,
Neeraj.
Santosh Jagtap
Greenhorn

Joined: Sep 20, 2004
Posts: 23
Originally posted by Neeraj Vij:
Hi,

humm...

Just for my help..

1.)before restarting the server clear the browser history and delete all temp. internet files which contains cookies too.
2.)then try to get the seesion variable value.


rgds,
Neeraj.


Hi
I tried tht still it prints the value.But onething is it happens only with tomcat i tried on oc4j it printed null.
Neeraj Vij
Ranch Hand

Joined: Nov 25, 2003
Posts: 315



try it by clearing the temp. work area directory of tomcat.

rgds,
Neeraj.
Santosh Jagtap
Greenhorn

Joined: Sep 20, 2004
Posts: 23
yeah i tried tht also still it is coming...
i think tomcat must be persisting each session...
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12825
    
    5
Servlet engines are allowed to serialize sessions out to disk - thats why it is a good idea to make sure all objects "stored" in sessions are Serializable. Take a look at your server.xml file in Tomcat for references to persistent sessions.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: does session remain alive even if i shuts down the server in tomcat?