473,890 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Replacing or improving Session vars usage - advice


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

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

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,
Feb 22 '06 #1
1 2009
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.CreateOb ject("msxml2.DO MDocument.3.0")

oDOM.loadXML "<config />"

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


Function AddElem(parent, name, value)

Set AddElem = parent.createEl ement(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.,

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).

Feb 23 '06 #2

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

Similar topics

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.. I have a php request_form that I use 2 different ways: by itself (url directly to the form) and as an include to be displayed in existing php pages. This form uses POST to another php_script that performs serverside validation and db write. If all...
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 cookie gets set, but i don't seem to be able to store any vars in the session? am i missing something? any help appreciated, micha
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 The problem I am having is that each time I reload the same PHP page, I get
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
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 session object (using state service). I'd like to start breaking out our functionality into component projects, but I'd like to get this session issue worked out first. Any ideas?? I found this article , but it sounds like kind of a pain.
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 especially important to know if the session vars contain things like credit card numbers.) Any better, more secure alternatives? How would you store credit card numbers etc... temporarily if not using session vars? Thanks!
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 load a huge data table into a session variable and watch my aspnet_wp.exe (w3wp.exe on 2003 server) increase it's memory usage by about 70,000 KB to 150,000 KB. I then click a Logout button, which uses Session.Clear and Session.Abandon. The memory...
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 temporarily is placed on the client's machine until the session ends? ...so that you can't use session variables if the client has disabled cookies on their browser? So, this makes session vars much more secure than hidden fields, which are transmitted...
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 the forums package. The creator of the forums package provides what seems to be an easy workaround for this. Create two session variables, one for ID, the other for Password, and his program will take care of the rest. I have all of my forums...
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.