1

What options are there to implement an own session management in ASP.NET?

I just found one older solution about "highjacking" the built-in session management.

Is there a nice way to implement a component which performs all session tasks? How can i include a class which receives the HTTP Request and Response during one request process?

Thanks for your help

Regards Michael

laalto
  • 150,114
  • 66
  • 286
  • 303
Michael S
  • 189
  • 3
  • 12

2 Answers2

3

You need two things, implement the IHttpSessionState and a HttpModule. In the HttpModule you hook the applications AcquireRequestState and ReleaseRequestState events.

In the Web.Config you need to remove the default session module and include your own.

The System.We.SessionState namespace has a number of other classes that you can uses in your implementation if you desire and/or you can use for a reference pattern.

AnthonyWJones
  • 187,081
  • 35
  • 232
  • 306
0

Check out this article @ MSDN. Please note, that SQL Server and Session State Service providers are built-in in ASP.NET, so if it is enough for you - you can try out one of these...

Michał Chaniewski
  • 4,646
  • 1
  • 18
  • 15
  • As far as i can see, this only aims on implementing an own storage mechanism but not the whole session management. Anyway thanks for the information! – Michael S Jul 17 '09 at 08:38