Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 981163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:29:57+00:00 2026-05-16T04:29:57+00:00

By default tomcat will create a session cookie for the current domain. If you

  • 0

By default tomcat will create a session cookie for the current domain.

If you are on http://www.example.com, your cookie will be created for http://www.example.com (will only work on http://www.example.com). Whereas for example.com it will be created for .example.com (desired behaviour, will work on any subdomain of example.com as well as example.com itself).

I’ve seen a few Tomcat valves which seem to intercept the creation of session cookies and create a replacement cookie with the correct .example.com domain, however none of them seem to work flawlessly and they all appear to leave the existing cookie and just create a new one. This means that two JSESSIONID cookies are being sent with each request.

I was wondering if anybody has a definitive solution to this problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T04:29:57+00:00Added an answer on May 16, 2026 at 4:29 am

    This is apparently supported via a configuration setting in 6.0.27 and onwards:

    Configuration is done by editing
    META-INF/context.xml

    <Context
    sessionCookiePath=”/something”
    sessionCookieDomain=”.domain.tld” />

    https://issues.apache.org/bugzilla/show_bug.cgi?id=48379

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We need to change the session ID length generated by tomcat. By default it
Grails 1.3.6 Tomcat6 I created a production ROOT.war. Deleted the default tomcat ROOT directory.
By default Tomcat only listens on localhost when run using mvn tomcat:run. How can
We are using the Windows installation of Tomcat 6. By default, the log4j output
I'm working on Liferay 6.1 bundled with Tomcat 7.0. I've created my own layout
Does Java have a default System Environment Variable that will always be read/appended when
I am trying to embed activemq broker in a Tomcat. The code base will
Installed Tomcat 6 Installed Eclipse + GWT plugin Created GWT project with sample generated
I created a Play! app and deployed it under TomCat. This works well. The
By default, Tomcat sends some HTML content back to the client if it encounters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.