473,372 Members | 1,352 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,372 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 1310

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

Similar topics

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...
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...
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...
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....
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...
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...
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,...
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...
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...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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...

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.