Bug 43366 - Session Statistics command in manager fails with "Unknown command /sessions"
Summary: Session Statistics command in manager fails with "Unknown command /sessions"
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Manager application (show other bugs)
Version: 6.0.14
Hardware: Other All
: P2 normal (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL: http://tomcat.apache.org/tomcat-6.0-d...
Depends on:
Reported: 2007-09-12 08:15 UTC by Greg Johnson
Modified: 2008-05-01 13:50 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Greg Johnson 2007-09-12 08:15:55 UTC
A documentation page for Tomcat 6 at
allows for the following command to be used in the manager:

This used to work in Tomcat 5.
In Tomcat 6, the following error is returned:
FAIL - Unknown command /sessions 

I have created two different installations of Tomcat 6.0.14 (one on CentOS 5,
and one on Fedora 7). Both installations exhibit the same failure.
Comment 1 Peter Rossbach 2007-09-14 23:41:52 UTC
The manager API has changed at 6.0.x ! Currently only the HTMLManagerServlet /manager/html/sessions 
is supported. :-)

I hope Remy or Rainer can help

Comment 2 Mark Thomas 2007-09-15 06:18:38 UTC
Re-opened as at a minimum, the docs need to be updated.
Comment 3 Greg Johnson 2007-09-15 07:07:41 UTC
It's frustrating when functionality like this simply disappears when moving to a newer version. We have 
scripts that monitor our tomcat servers using the sessions command. (We use 'curl' to get the results, and 
then process the information.) The "text" version of this command worked great, and served our purpose. 
Sadly, the html version referenced above does not provide the same information (session information 
broken down in ten-minute ranges).....even after sifting through the HTML formatting.....something you 
don't want when using a commandline tool like curl.
Comment 4 Peter Rossbach 2007-09-15 10:06:34 UTC
OK, I talk with Rainer to make a port from tomcat 5.5!
Comment 5 Mark Thomas 2008-04-27 11:08:15 UTC
Looking at the svn history, the functionality is still there it is just that the command name changed (to expire) when additional functionality was added to enable sessions to be expired.

I have added back the sessions command but marked it as deprecated as it may well be removed in a future version.

The fix has been committed to svn and proposed for 6.0.x
Comment 6 Rainer Jung 2008-04-28 01:10:38 UTC
In TC 6 the HTML manager got a new feature behind the command "sessions". It lists individual sessions and allows to invalidate individual sessions, remove attributes etc. This is feature A.

Somehow parallel in time I saw, that the old sessions feature (session statistics by maxInactiveInterval) was pretty useless, in most cases maxInactiveInterval is constant for all sessions in one context. So I wrote a somewhat more useful thing, namely a session statistic by idle time. This is feature B.

Unfortunately when I wanted to commit the new thing, the HTMLManager already had the new sessions feature A under the name "sessions". I decided to put B in ManagerServlet and HTMLManagerServlet under a consistent name, now using "expire" instead of "sessions".

With your latest commit, "sessions" is back to the ManagerServlet, but it does B, whereas in HTMLManagerServlet it does A. This is correct with respect to backwards compatibility but a little confusing.
Comment 7 Mark Thomas 2008-05-01 13:50:09 UTC
This has been applied to 6.0.x and will be included in 6.0.17 onwards.