Re: Session object

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: John Saunders (johnwsaundersiii)
Date: 12/13/04


Date: Mon, 13 Dec 2004 10:43:05 -0500


"jsale" <jsale@discussions.microsoft.com> wrote in message
news:4FE4FC87-EC13-4E73-BBDD-4D4A29145FC0@microsoft.com...
>I have an asp.net application that uses classes to store data between the
> user interface and the SQL Server database. Each user needs to see only
> their
> data at any time, therefore I am using session to hold the classes.
> Currently
> I use this on page load:
> XProject = Session("XProject")
> where XProject is the class I require to be at session level.
> My question is, for this to be correct, and to stop data leaking to other
> users if they are executing code at the same time, do i need to put a:
> Session("XProject") = XProject
> before redirecting to other pages in the site?
> I'm still quite new to session and my site appears to read and write data
> correctly, but from time to time, when a few users are using the web
> application, data can be saved on one users' project and be seen on
> others,
> causing errors and security risk.

If you never put the object anywhere other than in Session, then you should
not see it leak to other users. This should only be happening if the object
(or pieces of it) is stored in a Shared variable, a global variable in a
Module, or in Application state.

Look around your code for things like these (especially modules). I usually
recommend that all modules should be replaced with Classes, and this is one
of the reasons.

John Saunders



Relevant Pages

  • Reason 0.1.0 (New Nessus Client)
    ... Reason is an application/network security scanner client for Nessus and Nessus compatible servers. ... In addition to an improved user interface, it provides complete session management, templates, and report generation using XSLT. ...
    (Pen-Test)
  • RE: Multiple user problems
    ... details straight away:) ... i'm using an asp.net app that is connected to a sql server database and uses ... into session. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Session object
    ... jsale wrote: ... > the user interface and the SQL Server database. ... > where XProject is the class I require to be at session level. ... What is stored in the Session is just a *reference* to your instanced class. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Help! Back button - Redesign Project???
    ... I solved it by doing a State machine in my session. ... > into a Sql Server database), what's to prevent them from pressing the ... > back button and resubmitting the form multiple times and creating ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Multiple user problems
    ... > the data in the *instance* of the class using an index key. ... > variables are instanced using session. ... >>> i'm using an asp.net app that is connected to a sql server database ... >> John Saunders ...
    (microsoft.public.dotnet.framework.aspnet)