I have a problem that I have been scouring the internet for the past few days. I have found people with similar problems but whos solutions didn't advance my state.
What is most irritating is that I have been working with this before, without problems or any blocks.
The thing is that my sessions on my java web application, is either getting deleted inbetween requests or not create correctly to begin with.
Some simple trouble shooting:
I have had this to work before without even giving it as much as a single thought.
I just use the: In jsp I just session.get/setAttribute() In servlet I just request.getSession()
I have also looked into the getSession(boolean created), but as far as Im concerned getSession() should do it for me?
My server is running Tomcat 7 and have Servlet 3.
I can see the with servlet 3, that I have to declare some things in the web.xml file, my session config is as follows:
<session-config>
<session-timeout>30</session-timeout>
<tracking-mode>COOKIE</tracking-mode>
</session-config>
You think im doing something wrong in my code? it seems far to simple, and have used it times before. But this is the first time I have had the task to also setup the servers configuration.
This is my first post on stackoverflow, have found many answers before here, and hope someone can tell me where I am being an idiot. Hope I have given comprehensive details. Thanks in advance.
Sometimes its hard to search for a solution, when you don't exactly know what the problem is.
The problem was with the apache proxy setup for tomcat.
Here is the link for anyone else that might stumble upon my way of formulating the problem.
Apache 2.2 Virtual hosts + Tomcat 7 applications
adding ProxyPassReverseCookiePath /testapp / to the httpd config.