tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mario Killmer" <>
Subject Tomcat will not create session cookie
Date Fri, 13 Jun 2008 09:56:34 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>
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 ? 




  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message