my dog learned polymorphism
The moose likes HTML, CSS and JavaScript and the fly likes create new session in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "create new session in jsp" Watch "create new session in jsp" New topic

create new session in jsp

TD Bartos

Joined: Mar 29, 2005
Posts: 9
is there anyway to create/spawn a new session from my jsp page?

i'm using javascript:, name, attributes) to create a new window, and i need this window to be in a different session.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

Originally posted by TD Bartos:
is there anyway to create/spawn a new session from my jsp page?

No. This behavior is very browser dependent. In particular, Netscape considers all windows spawned from the same window to be part of the same session.

What are you trying to accomplish? Maybe there is another way.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
TD Bartos

Joined: Mar 29, 2005
Posts: 9
i have a main window and a pop-up window using a session javabean containing all of my database connection info. the new feature i'm trying to add would allow: from this pop-up window some words displayed in the text to be hoppable or links of some sort - and the action in this link would be to retrieve different information from the same or a different database. this third popup window is basically another instance of the first window but possibly connected to a different database. if this remains in the same session - then i've hosed up my session connection information in the first window. if i cannabolize the first window rather than creating a third window, then the user's trail or previous results have been lost.
the current business requirement for this feature calls for a new window to be spawned - unless i push back and tell them they can't accomplish what they really want to do.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63838

Why do you feel that you need separate sessions in order to handle communications with more than one database?

[Asking smart questions] [About Bear] [Books by Bear]
TD Bartos

Joined: Mar 29, 2005
Posts: 9
i already have a whole web application developed around using session scoped javabeans -- for example the biggest is a "DatabaseInfoBean" which maintains server and connection info for the database and a gazillion different configuration items for the database (this isn't your average jdbc connection, but my company's database format). but the pages also already use a "navigationBean", a "preferencesBean", a "storedQueryBean" etc etc etc.
the contents of this third window should operate the same as the first window - but window 1 and 3 can't be allowed to trip all over each other. if they were in different sessions, then they would each have their own set of javaBeans.
Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
As far as I know, it's impossible to have two sessions open from the same browser instance. Seems like you might have to rename the beans.
I agree. Here's the link:
subject: create new session in jsp
It's not a secret anymore!