Java,Tomcat,Sessions - JSessionId disappear
- by Bob
Hi,
I'm having a problem with java sessions.
I'm developing a simple web app, where I have to use sessions and session attributes. Everything is fine until I close my browser. When I close my browser the JSessionId disappears.
Here's my code:
request.getSession().setMaxInactiveInterval(30*60); //it's 30 minutes
request.getSession().setAttribute("someinteger", 10);
It works great, but when I shut down the browser, and reopen it I can't find the jsessionId (before I closed the browser I could find it in the 'localhost' section). The strange thing is I can still find the "someinteger" cookie. What is the problem? What am I doing wrong?
I'm using this, too: link text, and it shows that JSESSIONID cookie expires : "SESSION", and "someinteger" expires in 30 minutes
Thanks in advance.