-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Adam,

Adam Lipscombe wrote:
| In my app I spawn a new IE window with window.open(). I want the new
| window to share the same session as the parent, because it needs to
| access some session data.

If you are using cookies to track session ids, this should happen with
no work on your part. If you need to support cookie-less users, you will
need to...

| 1. Giving the window a unique name in the window.open() call like this:
|    window.open(url, "W+<%=session.getId()", options);

The name of the window should be irrelevant.

| 2. Passing the session ID to window.open) as part of the url like this:
|    var myUrl = url + ";JSESSIONID=<%=session.getId()"
|    window.open(myUrl ,....)

This is a slightly better strategy, but what you really want to do is:

var myUrl = "<%= response.encodeURL(url) %>"; window.open(myUrl);

When you use response.encodeURL, the server will decide if the
jsessionid parameter (which is lowercase, by the way) is necessary and
add it if so.

| Neither of these make it work reliably.
| My research shows that its probably an IE issue, and the general rule of
| thumb is not to try to share sessions across multiple windows
|
(http://classicasp.aspfaq.com/general/how-do-i-manage-a-session-across-multiple-windows.html)


It's funny, because most people posting to this list are asking how to
do just that: open a new window with a separate session. The only good
way to do that is the opposite of what you need to do: turn off cookies
and then /intentionally/ suppress the jsessionid parameter from being
added to the URL that will go into the popup.

Funny how the world works that way.

Hope that helps,
- -chris

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

iEYEARECAAYFAke98w8ACgkQ9CaO5/Lv0PDf2gCeM8dofrklolX5rk7bnRpppuq1
3NUAnAvXkPkxcZv7Vg5fzBbE9pOFOGWQ
=6Oiu
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to