views:

729

answers:

1

I'm trying to integrate a public message board service into an existing web site.

The handshaking between the apps goes like this:

1) File on my web site loads a flash file. The Flash reads a local variable that is the Session ID, or some other GUID unique to the user session.

2) Flash app connects with the remote service, passing the SessionID to the service.

3) The service issues a GET request back to the originating web site, asking for additional information about the user.

4) The originating web site (my site) validates that the session ID is for a valid session, and if yes, passes back the other requested information.

I'd like to be able to use the intrinsic ASP SessionID but I'm not sure how in Classic ASP to retrieve session variables for a specific ASP Session, ie, I want the value of Session("FirstName") where SessionID=1234 and not Session("FirstName") for any other session ID. I haven't been able to find any syntax that would allow me to do this.

The alternative is to create a new GUID for every session, but that's adding a lot of overhead.

Any ideas?

+1  A: 

I'm not aware of any way to retrieve Session details for a particular instance or ID. However, you could utilise the Application object to store the information you need using the Session.SessionID value:

Application(Session.SessionID & tag) = myTagValue

This way you are not creating a new GUID, but utilising the already existing one for session that both client and server are using in your example.

Clever, and I suppose this wouldn't require Application.Lock/Unlock as the values are always different. It would require explicit removing of the Application variable as soon as we're done with it, lest the memory run out. Interesting approach though, thanks!
Thumbkin