Question

In an asp.net application, i would like to use a webservice to return the username associated with the session id passed as a parameter. We're currently using InProc session store.

Is it possible to do this ?

Edit: what i'm trying to do is get information about another session than the current one. I'm not trying to get the SessionID, i've already got it. I'm trying to get the user information associated with a given SessionID.

Thanks,

Mathieu G.

Was it helpful?

Solution

You could possibly create a "fake"cookie with the session ID and make a request to your web service using it, so that the web service was fooled into thinking you were part of the session, enabling you to read any info from it. Sounds like quite the hack, though :)

OTHER TIPS

Something like:

HttpSessionState ss = HttpContext.Current.Session;
HttpContext.Current.Response.Write(ss.SessionID);

That will get the current sessionID.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top