0

I'm messing around with global.asa and I'm wondering if it's possible to create unique Object ID's using variables. Below is my example.

<object runat="server" scope="session" id="TDI" progid="tdrules.TD_Engine"></object>

My ID is currently TDI. What if I appended session.sessionID for a unique ID every session. So it looks something like this. I'd use a session variable so I could then reference that unique object ID throughout my current project.

session("TDISession") = "TDI_" & session.sessionID
<object runat="server" scope="session" id=session("TDISession") progid="tdrules.TD_Engine"></object>

And even if this is possible, are there any good reasons to do so?

MadV
  • 57
  • 4
  • 1
    it looks like you're confused about Application and Session scope concepts. an object stored in a Session variable is already unique and only accessible from the session created, so making names dynamic like `"TDI_" & session.sessionID` does not make sense. on the other hand, application scope is global so dynamic naming might work. what exactly do you want to do with this? – Kul-Tigin Feb 03 '16 at 00:26
  • That's how I understood it to work, but I have users somehow manipulating what seems like the same DLL instance and influencing each other's session's. I was curious whether this could be the cause, despite the object scope being for the session. – MadV Feb 03 '16 at 01:23
  • 1
    it may be a side effect of your com library design, but you can be sure that no one can achieve another session without having the `unique` session cookies that stored on the browser. by the way I can make suggestions about how you could instantiate objects with dynamic names in session state, if you're still interested? – Kul-Tigin Feb 03 '16 at 20:11
  • Thanks. That answers my question, which I guess was really about potentially overlapping sessions. I can now look at the DLLs as the culprits for the issue and trust that the sessions states are working the way they're supposed to. – MadV Feb 03 '16 at 21:24

0 Answers0