473,320 Members | 1,865 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,320 software developers and data experts.

Replacing or improving Session vars usage - advice

Hi,

I'm working on a VBScript application on IIS6 and I'm looking for some
advice about the best way of replacing or improving session variable usage.

The application is in a secure extranet environment. Currently the
application has a search customers page with 10 search fields which list the
results below the search fields. The requirement for this screen was that
the user could return to this result page at any point from any page in the
application and see his last set of results.

As a quick fix I used session variables to store the search values and
loaded them into the search page upon return. Works fine and didn't worry
me too much about using 10 session vars.

Now the users want similar functionality on all search screens (another 6)
giving me a potential of 60 session variables for search results (on top of
about another 10 legacy session vars).

Suddenly I am worried about 70 session variables, potentially containing
reasonably long strings, with a 2 hour session timeout for a potential 1000
users.

What would people recommend I do to either replace the session variables or
improve performance of them.

My thoughts are:

1. Store in the database alongside the user record. I'm already retrieving
the user record on most pages so it would be a case of getting the extra 60
fields from the DB when required. Would also provide cross session result
persistence.

2. Cookies. Have only ever used sparingly. Would this be too much data
for storing in cookies ? Any performance trade-off ?

3. Store an array/arrays in fewer session variables. Each search result
page could just have one session variable with an array of all the search
field values for that page. Would one session variable containing an array
be much better than 10 session variables ?

4. Just use the 70 session variables and stick more memory in the server if
we get issues. Probably the cheapest and easiest solution, though not the
right one I'm sure.

Any advice would be much appreciated as I'm kind of at the limit of what I
know about performance issues.

Many thanks,
Larry.
Feb 22 '06 #1
1 1950
Store the values in the database.
Rather than inventing a field for each value use XML.

Create a User Config table with the fields (I'm using SQL Server parlance)
:-

UserID int, Key varchar(512), XML ntext

When a page receives the search request it can create an XML DOM and store
the values in the XML:-
Dim oDOM

Set oDOM = Server.CreateObject("msxml2.DOMDocument.3.0")

oDOM.loadXML "<config />"

AddElem oDOM, "myField", Request.Form("myField")

....

Function AddElem(parent, name, value)

Set AddElem = parent.createElement(name)

If Not IsNull(value) Then
AddElem.Text = CStr(value)
End If

End Function
The user choices can then be saved from oDOM.xml property in the UserConfig
table. I use the the page URL as a key e.g.,
'/myFolder/mySubFolder/myPage.asp'

When the user revisits the page you use the UserID and the page URL to fetch
an XML string that you can then load an XML DOM with. You can subsequently
retrieve the values for the fields from the XML.

This approach is memory efficient and survives cross sessions (potentially
allowing you to drop the session timeout).

Anthony.
Feb 23 '06 #2

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

Similar topics

0
by: james | last post by:
I am new to php and need some help getting the session variables into include files. (after-thought, Sorry for the drawn out post but I really, really need help....;) Here's what I'm doing.. ...
8
by: chotiwallah | last post by:
i'm setting session.cookie_secure = "on" via .htaccess and it works - confirmed by phpinfo(). this i tought enforces a secure transmission of the session-id. as far as i can see, the session...
13
by: Mimi | last post by:
Hello, I am having trouble using the session vars in PHP 4.3.9 OS: Win XP Prof Web Server IIS (is local and there are no links to other servers from the web pages I work on) Browser: IE 6.0 ...
8
by: ndsoumah | last post by:
hello guys I'm trying to get access to variables I put in a session variable from another page and it fails... here's the exact situation main file page1.php
3
by: Mark | last post by:
Ok, I know that .net inherently does not share session data across asp.net projects, but is there any decent work around to this. We already have a big chunk of our application using the asp.net...
5
by: VB Programmer | last post by:
I often use session variables to store the user's security level, and other important info. How secure are session variables? Can someone decrypt it and get the information? (This would be...
1
by: Mike McDonald | last post by:
I am trying to free up some memory by forcing a session.clear and a session.abandon. When I startup the application, it starts at about 80,000 KB of memory in the aspnet_wp.exe. I am able to...
2
by: Jeff | last post by:
....still new to .net 2005 using VB. Do I understand correctly that the value of a session variable is actually stored in the server's ram, but relies on the asp.net session ID cookie that...
5
by: Terry On Windigo | last post by:
I think I have figured out my problem but I don't know how to solve it. We are going to start using a forums package and do not want our users to have to login to both our site, and then again to...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
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...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
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 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.