6

Possible Duplicate:
Get session object from sessionID in ASP.Net C#

How to get Session object by SessionId?

Community
  • 1
  • 1
Andrei Andrushkevich
  • 9,905
  • 4
  • 31
  • 42
  • 1
    @herbalessence: I think you're assuming this has something to do with flash. OP hasn't mentioned or tagged it as such. –  Mar 23 '11 at 14:40
  • @ Will : OP ? Not a duplicate ? – Saurabh Gokhale Mar 23 '11 at 14:42
  • @herbalessence: I don't think they are duplicates, but we can't tell without more info from OP. – UpTheCreek Mar 23 '11 at 14:52
  • This is obviously not a duplicate and if someone lands here after googling - you will have to use reflection. Start here https://stackoverflow.com/questions/8854176/get-a-list-of-all-active-sessions-in-asp-net/ for some clues – Alex from Jitbit May 24 '19 at 14:40

2 Answers2

1

My solution is direct access to storage of Session State.

example:

(for SQL) direct select query to ASPState database with tables(ASPStateTempApplications, ASPStateTempSessions)

Andrei Andrushkevich
  • 9,905
  • 4
  • 31
  • 42
0

This has actually been answered already, please look at this question on SO: Can I put an ASP.Net session ID in a hidden form field?, which references this link ASP.Net: Working around Flash Cookie Bug AKA restoring the session

Community
  • 1
  • 1
Tejs
  • 40,736
  • 10
  • 68
  • 86
  • sorry, can you explain it in more details? How can i get the session object by sessionId? – Andrei Andrushkevich Mar 23 '11 at 14:30
  • Why someone downvoted this answer ? – Saurabh Gokhale Mar 23 '11 at 14:31
  • According to the link, you would simply make a post to an HttpHandler that takes the session Id and then makes a cookie for it. Then, when the session is loaded, it takes your session Id and then loads it. The handler then has access to it. The link even has sample code for you to use. – Tejs Mar 23 '11 at 14:32
  • I didn't downvote, but these links don't seem to have much to do with the question - I think he want's to be able to access a session's contents from outside that session. – UpTheCreek Mar 23 '11 at 14:52
  • 1
    This doesn't solve the problem directly. When it is not a webpage but a different pipeline such as request handler or a signalR hub, it is not possible to get session object by simulating user provided a key. – Bamboo Oct 08 '18 at 16:46
  • The links provided don't solve the problem at all, if the code runs outside of http context – Alex from Jitbit May 24 '19 at 14:24