Can I specify, say the InProc Session Provider for one page, and a database backed session provider for all other pages?
Asked
Active
Viewed 617 times
0
-
Why do you want to do that? – trebuchet Dec 05 '12 at 23:32
-
I'd like my application to store session in a database, e.g. oracle or sql. But that requires that everything that is put into session to be serializable. However, there are some 3rd party components, (Crystal report viewers) that put nonserializable data into Session. In the past I've had to create a 2nd asp.net app & vdir to host just the pages that had the components that require inproc session-- that creates a ugly integration projects trying to make two applications behave as one (with one auth prompt, seamless navigation when ~/ isn't enough to find all pages, etc) – MatthewMartin Dec 06 '12 at 15:37
1 Answers
1
I believe you can. Please check the following article out: http://abhijitjana.net/2011/01/15/programmatically-changing-session-state-behavior-in-asp-net-4-0/

Hanlet Escaño
- 17,114
- 8
- 52
- 75
-
That example uses currentContext.SetSessionStateBehavior(System.Web.SessionState.SessionStateBehavior.ReadOnly); to change the session among: disabled, required, read-only or default, but it doesn't seem to allow changing any other characteristics of session. – MatthewMartin Dec 06 '12 at 15:49