473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Creating Specialized Session State Store

I'm trying to hook in a specialized state store server into ASP.NET.

I understand I can create a HttpModule and hook the events
OnAcquireState and OnReleaseState. So far so good.

But, it seems that the framework owns the HttpSessionState instance
(HttpContext.Session) and so my state store module must use the Add,
Remove and Clear methods to interact with the store. ie. on Acquire, I
need to call HttpSessionState.Add to add all the persisted state
variables into HttpSessionState and on Release, I need to persist the
state from HttpSessionState back to my store. To do this I can just
use the indexer in HttpSessionState.

But this is going to be slow as I will be saving and restoring the
entire session state. If the session state is very large, I wan't to
only persist those items that have changed. I could keep a copy and
compare what has changed, but that will be 2x the session data and is
also an overhead.

What I'd really like is a lower level interface so that I could only
save session state items that have changed and not have to serialize
the entire state on Release. Since HttpSessionState owns the in-memory
session state dictionary, I can't see how I can do this. I'd really
like to create my own HttpsessionState instance and control every
set/get to the HttpSessionState. To do this I need to set the instance
pointer in HttpContext. I'd like to do this in my module's
BeginRequest event. But, the problem is there is no SetSession method
in HttpContext to use.

Any ideas ?
Nov 18 '05 #1
0 1312

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Leon | last post by:
Is it a good idea to load a user username/email and password into session state if you will be validating information against those credential through-out the use of the web application? or is it...
3
by: Nhi Lam | last post by:
Hi, I understand that there are 3 modes in which I can configure the SessionStateModule. What I need is an out of process Session State store with fail over support. The "SQL Server Mode" seems...
2
by: adam | last post by:
Having spent nearly 2 years in win forms land the inevitable request came for me to "do some web pages". So being new to this bit of .net and having had a look around I can't see where the best...
3
by: Matt Mercer | last post by:
Hi all, I have read much about session variables and the pros and cons. I want to post my use and get opinions. When a user logs into my site various fields are pulled from a SQL user table....
1
by: Johan Nedin | last post by:
Hello! I have a problem with SQLSession state on my ASP.NET pages. SQLSession state behaves very different from InProcess session state, which I think is very bad. I can understand some of...
9
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of...
7
by: Mr Newbie | last post by:
I have written a Custom Control Menu. Its fairly simple but it works well enough. In order to simplify things I decided to store the Menu1 custom control in Session. In the page load event below,...
5
by: Steven Blair | last post by:
I have the following code: Session = new CurrentUser("TEST"); When I postback to the server, the Session is null. My guess is a only the refence to my actual class is stored, rather than the...
11
by: Glenn | last post by:
Hi I've been experimenting with managing state using the Session object. I've created a simple WS with a couple of methods, one which sets a string value, another that retrieves it. Each...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.