tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mkweb <>
Subject Tomcat will not create session cookie
Date Fri, 13 Jun 2008 09:44:51 GMT

I'm new to the forum. I have a strange problem with my tomcat installation.
I'm using tomcat5.5.26 and struts for my web projekt.

I configured the projekt in a context file, like this :
<Context path="" docBase="C:\webprojekt" debug="1" reloadable="true"
crossContext="true" cookies="true">

I set the attribute cookies to 'true' because I want to have session

Furthermore I added the following lines to the index.jsp to display the
cookies :

out.println("<h>Cookies : </h>");
Cookie[] cookies=request.getCookies();
if(cookies==null) { 
out.println("No cookies");
} else {
Cookie MyCookie;
for(int i=0;i<cookies.length;i++) {
out.println(MyCookie.getName() + "="+MyCookie.getValue());

My problem is now when I open the webapp with the url http://localhost
everythink is fine. The session cookie wil be created and the output of the
script above is like : 
Cookies : JSESSIONID=05E932958950B69BE03874B8FCE26C3E 

But when I open the webapp over the internet with an URL like tomcat will not create an session cookie. Tomcat adds the
jsessionid to the URL's and teh output of the script above is :
Cookies : No cookies

What is the problem ? Why can't tomcat create session cookie for ?


View this message in context:
Sent from the Tomcat - User mailing list archive at

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message