You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "M. Manna" <ma...@gmail.com> on 2020/02/09 23:32:31 UTC

Question on HttpSession investigation

Hello,

I apologise in advance if the answer is obvious for this question. We are
trying to investigate (in an isolated cluster) whether our session
attributes are getting lost somewhere in the process.

The issue is that we are setting it at a JSP Tag Level, however, when we do
an AJAX request back to the same server, the session doesn't have the
attribute set by the tag. Since it's two different servers, we would like
to check using JMX whether this is present somewhere in session. Debugging
has not resulted into a successful outcome.

We appreciate if this is not possible, but just wanted to check if tomcat
currently emits anything related to this.

Regards,

Re: Question on HttpSession investigation

Posted by Konstantin Kolinko <kn...@gmail.com>.
пн, 10 февр. 2020 г. в 02:32, M. Manna <ma...@gmail.com>:
>
> [...], we would like
> to check using JMX whether this is present somewhere in session. Debugging
> has not resulted into a successful outcome.
>
> We appreciate if this is not possible, but just wanted to check if tomcat
> currently emits anything related to this.

The Manager web application (that comes with Tomcat) is able to
display contents of a session:

- Click on the number that shows the count of active sessions in a web
application. You will see a list of active sessions.
- Click on sessionid. You will see a list of all attributes for that session.

You may look into the source code for HTMLManagerServlet to see how
"sessionDetail" command is implemented.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Question on HttpSession investigation

Posted by Luis Rodríguez Fernández <uo...@gmail.com>.
Hello M. Manna,

I do think HttpSession.getAttributeNames(), HttpSession.getAttribute(name)
should be good enough for debugging your issue. You can have a look at the
good and classic examples servlet [1] included in every tomcat distribution.

If you want to be sure what server is serving your request you can print as
well the server's IP or hostname
using Inet4Address.getLocalHost().getHostName(). Or even simpler you can
add a system property like -Dserver.name=serverA and print it.

Hope it helps,

Luis

[1]
https://github.com/apache/tomcat/blob/master/webapps/examples/WEB-INF/classes/SessionExample.java









El lun., 10 feb. 2020 a las 0:32, M. Manna (<ma...@gmail.com>) escribió:

> Hello,
>
> I apologise in advance if the answer is obvious for this question. We are
> trying to investigate (in an isolated cluster) whether our session
> attributes are getting lost somewhere in the process.
>
> The issue is that we are setting it at a JSP Tag Level, however, when we do
> an AJAX request back to the same server, the session doesn't have the
> attribute set by the tag. Since it's two different servers, we would like
> to check using JMX whether this is present somewhere in session. Debugging
> has not resulted into a successful outcome.
>
> We appreciate if this is not possible, but just wanted to check if tomcat
> currently emits anything related to this.
>
> Regards,
>


-- 

"Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."

- Samuel Beckett