• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

container creating session automatically

 
Sigrid Kajdan
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

my web app does not use sessions (there's no request.getSession()) anywhere).
But I find that the jsessionid cookie is set anyway!
Can anybody tell me why that's the case? Does Tomcat send the jsessionid cookie automatically?
Thanks a lot,
Sigrid
 
Stary Kapec
Ranch Hand
Posts: 81
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your application contain jsp pages? If so that is the case. Jsp page implicitly creates new session if none exists. You can turn it off by using page directive with session attribute.

<% page session="false" %>

If you checked the generated java file for the jsp page there you would see HttpSession session = request.getSession(). This is how the implicit jsp session object is initialized. If you turn session off the session object will not be created, check it!
 
Sigrid Kajdan
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it works! Thank you!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic