0
votes

In my current assignment - I have to implement a solution for the session state management issue. The current implementation is as follows:

  1. There is a asp.net form that allows you to add multiple entries to form a batch.
  2. The fields represent a single entry (most of the fields are auto complete) - once you fill all the fields and click the 'add' button - the entry gets added to a grid view - Each time the 'Add' button is clicked it causes a post back and the grid view repopulates displaying the previous entries.
  3. After repeating the above steps multiple times to enter multiple entries - all are displayed in the grid view - you then click the 'Enter Batch' button - that submits all the entries in the grid view as a batch to the database.

The issue: To enable most of the above functionality - there is session state (InProc) implemented all over the page and other pages as well. The problem is - Users can open multiple instances of the same application, and then the application goes crazy. The other issue being - at times the application kick off the users and they have to re log in and when the do that all the entries they where doing in the batch are gone from the gird view.

I see session implemented everywhere on the web form. The most obvious solution to resolve the above two issues - is to implement a Session State (SQL Server) mode.

But before I move ahead with the implementation I have couple of questions, If anybody can help:

1 Can I change the current implementation (so that I don't have to re write the session variables already used on the web form - as they are two many) - I tried to change the web.config to have the (sessionstate cookieless="true" - I was hoping this would put the session ids in the URL, in turn enabling session state of multiple instances) - however after doing that - the auto complete feature on most of the fields don't work, so I have change the config to allow cookies based. So is there a way to change the current session implementation to make it work properly around multiple instance of the application.

  1. If I have to implement session state afresh - can someone give me a brief overview of how to implement the Session State (SQL server mode) so that it works around multiple instances - like what to use for unique key (how to set and get session variables base on this key for multiple instances) and how to configure the tables in database etc.

Note: the current session state is 'InProc' mode and I can say that cause there it is not set anywhere so I think that's the default. The session variables are pretty standard in the current implementation.

This is a new project I have started - and this is my first assignment - however the code is really messed up - it dose not have a modular or even the basic 3 tier implementation. The code is very unmanageable and hard to debug.

Any help and suggestions are much appreciated. Thank you guys.

1

1 Answers

0
votes

All that is required is given at Session-State Modes.

Your code for storing/retrieving session state does not change.

Is State Server Mode out of the question?