I have two applications located on the same tomcat7 server:
Now what I want to achive is that the writeApplication writes something into the session, afterwards the readApplication gets started and reads this information out of the session.
In both web.xml files I inserted:
<session-config>
<session-timeout>720</session-timeout>
<cookie-config>
<name>JSESSIONID</name>
<path>/</path>
<http-only>true</http-only>
</cookie-config>
</session-config>
In the writeApplication (a simple servlet) I write into the session like:
HttpSession session = req.getSession();
session.setAttribute("test", "myString");
Like wished the JSESSIONID
-Cookie is written to "/"
so https://my.application.com/.
In my readApplication (a GWT application) I want to read this information out of the session by using:
HttpSession httpSession = getThreadLocalRequest().getSession();
String myString = (String) httpSession.getAttribute("test");
In this case I always receive null
.
If I write something by the readApplication the path is the same like in the writeApplication, but if I want to read I can't get the information I was adding with the servlet.
Shouldn't it work like this?