Solved

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

Posted on 2004-10-12
5
146 Views
Last Modified: 2013-12-24
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
Comment
Question by:sulzener
  • 2
  • 2
5 Comments
 
LVL 35

Assisted Solution

by:mrichmon
mrichmon earned 200 total points
ID: 12291701
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
 

Author Comment

by:sulzener
ID: 12292217
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
 
LVL 17

Expert Comment

by:Tacobell777
ID: 12292662
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
 

Author Comment

by:sulzener
ID: 12298866
tacobell777 ... Based upon my sample above, is it possible  to do what you are suggesting?  If not, do you have a sample?
0
 
LVL 17

Accepted Solution

by:
Tacobell777 earned 200 total points
ID: 12302046
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Internal DNS Alias (CNAME) - two domain names to one IP address 4 81
IIS url rewrite rule for web application 3 62
Website URL redirection 10 73
Problem to go to Web page 2 126
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question