on ‎2010 Feb 09 8:53 PM
Hi all,
I need to allow for multiple sessions in our app. Mostly is OK, except for the popup windows. I think I need to put a "session id" in the page title. I can make a hash of the login time and date and user name, but would really prefer a real session id.
Is there a way I can get the http session id?
Thanks,
--Amy Smith
--Haworth
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amy,
Were you able to get this to work by passing in the session id (or another unique value per user session) to the page title and allowing multiple popups of the same page for different sessions?
If so, can you show me the code you used for dynamically setting the title as I was having some issues setting the title based on the session?
Thanks,
Kerby
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kerby --
I misspoke (miswrote?) about the page title. I really meant the window title in the window.open() javascript.
window.open('/XMII/CM/APEX/dispatchReport.irpt?isReport=true', 'dispatchReport' + $('#sessionId').val());This -$('#sessionId').val()- is jquery for the value of the element with and id of sessionId --- like this in the .irpt
<input type="hidden" id="sessionId" value=""/>
Does this help? I can post the javascript to save the session id to the session variable, but it is really hard to post javascript so I don't want to unless you need it too! If you want that let me know.
--Amy Smith
--Haworth
Hi Amy,
Could you post it if that'd be ok? Below is what I was trying to do and I think I have a misunderstanding/syntactical issue with what I was trying to do (username+timestamp) but using the sessionID would probably be easier and better.
I tried just adding the userID below and that didn't work, and then I tried using your syntax for referencing the txtLoginName+timestamp and didn't seem to work either. Thoughts? I normally work in the BLS so less familiar with the IRPT popup passing.
Thanks,
Kerby
var strUserID=document.jaGrid_Procedures.getPropertyValue("IllumLoginName")"_"this.getTimeStamp();
// Open window, passing in parameters.
window.open("ProductSelector.irpt?&objSelected=" + strObjSelected
+ "&intWidth=" + intWidth,
"Product" + <strUserID/UniqueId here>
"height=650,width=" + (intWidth+40) + ",status=yes,toolbar=no,menubar=no,location=no,resizable=1");
Syntax of loginname:
<input type=HIDDEN READONLY value="" name=txtLoginName>
Hi Kerby,
Actually using the sessionId is *much* harder than what you were trying. It requires a jsp to retrieve the
session id when the user logs on, javascript to store it in a session variable and an element on the page
to retrieve the value of the session variable. Not simple and I am using ajax to store the variable.
If the user name and timestamp would work for you I suggest you pursue that. Especially if you are
not comfortable with web pages and javascript.
BTW: -this.getTimeStamp()- I don't recognize that as valid javascript. Maybe it is, but it didn't work for me.
I suggest the following which will yield something like this ---> Productmyuserid_1266607995753
So, every window opened should be unique because of the milliseconds value in the timestamp.
var dt = new Date();
var strUserID=document.jaGrid_Procedures.getPropertyValue("IllumLoginName")+"_"+dt.getTime();
window.open("ProductSelector.irpt?&objSelected=" + strObjSelected + "&intWidth=" + intWidth,
"Product" + strUserID,
"height=650,width=" + (intWidth+40) + ",status=yes,toolbar=no,menubar=no,location=no,resizable=1");
--Amy Smith
--Haworth
Hi Amy,
Thanks so much for the help. It works for me now! What you showed is actually what I had tried in the beginning but the getTimeStamp() was causing issues with it. The reason why (after comparing why your dt.getTime worked) is that the getTimeStamp returns a '-' after the day and the - caused an issue within the url. e.g. 2010219-121905804. When I replaced the - with an _ then it worked fine.
Thanks alot for the help.
Kerby
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.