Drive has 700+ articles for digital transformation leaders written by StarCIO Digital Trailblazer, Isaac Sacolick. Learn more.

One of the developers here has been hunting for a solution to the following configuration issue:In tomcat, a SESSION’s cookie path is automatically generated by Tomcat and set to the application’s context path (e.g., the name of the .war file). This creates somewhat of an issue as it forces all URLs of the application to live underneath this folder. The issue is that the application is now getting URLs that are three, four, and even five levels deep. Long URLs are generally bad for SEO (search engine optimization), so it would be great if we could eliminate the application context’s urls and have several root folder aliases that point to the same application.This can easily be done with Apache’s mod-rewrite, but the SESSION cookie path is the lingering issue. If the application name is ‘foo’, then the session cookie’s path will be set to ‘/foo’. If I create new urls that live in a different root folder, say ‘/bah’ and use Apache re-write to translate them to ‘/foo’, then the mapping works and the correct pages fire, but the SESSION cookie won’t be included in the browser’s request since it lives in the ‘/foo’ path.

Ideally, I should be able to set the SESSION cookie’s path to the root folder ‘/’. This would not create an issue for us since we only have one other application running, the default one, that handles static objects. Ideally, I’d rather not use our application as the default.

So if anyone has a solution to this issue, feel free to comment!

Thanks!

Published on:

Topics:

Leave a Reply


StarCIO

My company, StarCIO, provides leadership, learning, and advisory programs for companies looking to accelerate delivering business value from digital transformation. Contact me if you’d like to learn more about partnering opportunities.


Isaac Sacolick

Join us for a future session of Coffee with Digital Trailblazers, where we discuss topics for aspiring transformation leaders. If you enjoy my thought leadership, please sign up for the Driving Digital Newsletter and read all about my transformation stories in Digital Trailblazer.


Coffee with Digital Trailblazers hosted by Isaac Sacolick

Digital Trailblazers! Join us Fridays at 11am ET for a live audio discussion on digital transformation topics:  innovation, product management, agile, DevOps, data governance, and more!


Join the Community of StarCIO Digital Trailblazers

2 comments:

  1. Yep. What you want is for the cookies to all have a path of ‘/’.

    If you are using Tomcat, go to the conf/server.xml file, find the Connector tag, and add this to the Connector tag’s list of attributes:

    emptySessionPath=’true’

  2. Thanks Michael. It took me a while, but I eventually found this solution and it works like a charm.

    I published the solution here:
    http://ctotodevelopers.blogspot.com/2006/11/how-to-tomcat-applications-with.html

    as part of a larger solution of configuring Tomcat for multiple folders

About Drive

Drive Agility, Innovation, Transformation

Drive is the blog for digital transformation leaders brought to you by StarCIO and Isaac Sacolick.

Agility, Innovation, and Transformation are the three primary digital transformation core competencies that every StarCIO Digital Trailblazer must champion in their organizations. Learn more About Drive.


About the StarCIO Digital Trailblazer Community

StarCIO Digital Trailblazer Community

Revolutionizing traditional learning, networking, and advising experiences.

Visit the community


About StarCIO

StarCIO

About Isaac Sacolick

Isaac Sacolick

Author, 1,000+ articles, keynote speaker, Chief StarCIO Digital Trailblazer. Full bio


Driving Digital Newsletter

Driving Digital Newsletter

StarCIO Guides

StarCIO Agile Planning Guides

Digital Trailblazer

Digital Trailblazer by Isaac Sacolick

Driving Digital

Driving Digital by Isaac Sacolick

Driving Digital Standup

Driving Digital Standup

Coffee with Digital Trailblazers

StarCIO Coffee With Digital Trailblazers

Recognition

InfoWorld 2025 Judge
InfoWorld Technology of the Year 2024 Judge
Thinkers360 Top 10 in IT Leadership
Thinkers360 Top Agile Thought Leader
Thinkers360 Top DevOps Leader
Thinkers360 Top in Digital Transfomation
Thinkers360 Top in Analytics
Thinkers360 Top in Product Management

Discover more from StarCIO Digital Trailblazer Community

Subscribe now to keep reading and get access to the full archive.

Continue reading