views:

178

answers:

1

I am searching to find a way to read and write on session data but with out having the HttpContext.Current.

Why I won to do that ?, because I wish to make some action with the user Session after the page have been close and unloaded.

For example, a user load and see a page, then I create a thread to make some action and let user go. Inside this thread I like to read the session data, but in this case HttpContext.Current is not exist any more.

So is there a way to read Session Data knowing just the session id.

I store my session inside an sql server, and I see them... its there on table ASPStateTempSessions :)

How can I read them "offline" and manipulate them ?

Thank you in advanced.

A: 

Hi Aristos

Still not quite clear why you might want to do that but you might not actually need to do it on Session_End(). At that point, it may be too late for you to work with the session data anyway (I've read some articles before about this). What might be a better solution is to actually attempt to work on the session data when your application actually has the context.

For example:

There's nothing to stop your application creating an asynchronous request on a new thread in the background (or even a different application, such as a Windows Service, for instance) when the specific session variable that you want is updated or has been set. This way, your application will be able to access the current HttpContext as well as all of the session data.

Not sure if this helps, but it was worth a shot ;)

Richard.

Richard
@Richard Thank you for the replay.Dear Richard I have use asynchronous threads on the pages, but this is something different that I ask for some reason that is a little complicate to analyse. In sort its a manner of speed. I am working on many workaround but I just wondering if there is any way to read the session data of any user by just knowing the sessionid. To say it with other words, lets say that I need to debug all session data from all users and see whats on them - how can I do it ?
Aristos