You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Juriy Bura <ju...@gmail.com> on 2011/04/27 22:08:05 UTC

Accessing (session) Manager in servlet

Hello everybody!

I need to access the Manager from the servlet (or filter) in Tomcat to load
the custom session by custom session ID.

Answering your next question: why do I need it. There's an old bug in Flash
that causes it to send cookies from IE and not from the current browser. So,
if I'm in FF and I'm trying to upload the file with SWFUpload I end up with
the wrong session and an error.

I want to add the magic parameter to POST that should override the default
(wrong) session id, then load the custom session instead of one loaded by
Tomcat. I can't use URL rewriting since cookies are resolved first, and when
flash sends wrong cookie from IE, Tomcat doesn't try to load the session
from url-rewritten address.

I'd appreciate any other hint how to access Manager from context or a
solution of the original problem.

Thanks in advance, Juriy

Re: Accessing (session) Manager in servlet

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Juriy,

On 4/27/2011 4:08 PM, Juriy Bura wrote:
> I need to access the Manager from the servlet (or filter) in Tomcat to load
> the custom session by custom session ID.

Wait, what?

> Answering your next question: why do I need it. There's an old bug in Flash
> that causes it to send cookies from IE and not from the current browser. So,
> if I'm in FF and I'm trying to upload the file with SWFUpload I end up with
> the wrong session and an error.

Wait, what?

> I want to add the magic parameter to POST that should override the default
> (wrong) session id, then load the custom session instead of one loaded by
> Tomcat. I can't use URL rewriting since cookies are resolved first, and when
> flash sends wrong cookie from IE, Tomcat doesn't try to load the session
> from url-rewritten address.

Have you tried disabling cookie-based session handling? That might solve
all your problems.

> I'd appreciate any other hint how to access Manager from context or a
> solution of the original problem.

Why do you need to access the "Manager"? What do you mean by "Manager"?
The class/object or the webapp?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk25fi8ACgkQ9CaO5/Lv0PCcJgCgrtfqO9SsxqgFhnx1GuHo2re7
PaYAoLUlUF4wFApmvv3XfRgq+BEaQ/Mi
=2Ivn
-----END PGP SIGNATURE-----

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


Re: Accessing (session) Manager in servlet

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/4/28 Juriy Bura <ju...@gmail.com>:
> I'd appreciate any other hint how to access Manager from context

a) use JMX, like the Tomcat Manager web application does

b) implement a Valve that does whatever you want. Valves have access
to Tomcat classes.

c) (hacky) Thread.getContextClassLoader() and follow some links

> or a solution of the original problem.

Update the Flash player?
You say the bug is "old" - is it still an issue?

Best regards,
Konstantin Kolinko

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