[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 152
  • Last Modified:

Need to open up new windows and be able to use unique session variable values with the same session variable names?

I have a situation where I need to open new windows (10 max) where the user can toggle back and forth between windows.  This is a lab inspection system where they will be inspecting up to 10 products at the same time.  Toggling between the windows.  Here is my problem:

I am passing url variables when I execute the windows.open command (see below).  I then wanted to make the url variables be session variables for the new window ONLY.  I want each window that opens to have unique session variable values, but the same names.  I am thinking that I need each new window to be independant of the other.  But it isn't working that way.  Once the session is set in one window, it changes the session values in all the other windows.

Any other suggestion are welcome.  Way to have each windows operate with independant session values, or an entiire different solution.  Here is the open.window command ... Thanks, sulzener

<SCRIPT LANGUAGE="javascript">
      window.open ('labEntry.cfm?rn=#Session.RunNumber#&pn=#Session.ProdNumber#&ud=#Session.UserDesc#&loc=#Session.LabLoc#',
               '#Session.RunNumber#','location=yes,resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes')
</SCRIPT>



0
sulzener
Asked:
sulzener
  • 2
  • 2
2 Solutions
 
mrichmonCommented:
You will not be able to store the information as session variables.

Session variables are associated with the instance of the browser.

SO take Internet Explorer for example.

If you click the blue E to run IE then you have started a session.

If you then press Ctrl+N or use any other method to open a new window - it is a child of the first and part of the same session.

If you instead click the blue E again a new instance of the program is run - therefore it has its own session info.


SO you cannot open new windows from within the same instance/session and expect to have different sessions.

You can use some other method such as continuing in the URL
You could name the session variables uniquely based off of a window ID
You could use form variables.

I just don't see a way to have "the same session and yet different sessions" at the same time.
0
 
sulzenerAuthor Commented:
Thank you for clearing up some confusion I was having regarding sessions.  Can you elaborate on creating session based on window ID.  Any samples of how to do that would be great.  
0
 
Tacobell777Commented:
You could make sure the urlToken is different in each window, which is a seperate session each time.
So, don't use cookies, pass the urlToken in the url, and as long as they are different for each session you'll have different sessions.

0
 
sulzenerAuthor Commented:
tacobell777 ... Based upon my sample above, is it possible  to do what you are suggesting?  If not, do you have a sample?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now