Re: Need Microsoft Help: Session object retrieving another user's Session information

From: Patrice (nobody_at_nowhere.com)
Date: 04/19/04


Date: Mon, 19 Apr 2004 20:45:04 +0200

A module is a class with shared variables (possibly as private members). As
such all users are sharing the same g_Info.

"Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> a écrit dans le
message de news:u6Tgc.24224$ej3.4539@newssvr27.news.prodigy.com...
>
> I'm building a complex web-based reservations system.
>
> Gathering the user's data requires between 8 and 15 pages (depending on
> which options they are interested in). I use the "Session" object to
store
> the various elements as the user moves through the pages.
>
> Rather than storing the preferences directly in the Session object (e.g.
> Session("LastName") = ...), I created a class
>
> <Serializable()> Public Class ReservationInfo
>
> This class has private variables for all the data, and exposes properties
to
> retrieve/manipulate the data. I did this for several reasons:
> * I don't have to worry about screwing up variable names from one page
> to the next (is it Session("OptionNumber") or is it
Session("OptionNbr")) --
> * I can add some logic related to the assignment of properties (e.g.
if
> a property changes, I might need to reset other properties)
>
>
> In one of my modules I declare
>
> dim g_Info as ReservationInfo
>
> And on each page, then, in the OnLoad event, I have something to this
> effect:
> g_Info = Current.Session("ReservationInfo")
>
> (actually, in the OnLoad event I call a public sub in one of my
> modules, and it does the retrieval. That's why it references
> Current.Session)
>
>
> and in the Unload event, I have
> Session("ReservationInfo") = g_Info
>
>
> This way my entire set of variables is loaded from the Session, and saved
> back to the session each time.
>
> I let .NET manage the Session object in memory (single server), and
> everything works great (or at least it did during my development/testing).
>
>
>
> The problem happened when we ran the first multi-user test (e.g. 5 people
> testing at the same time).
>
>
>
> Suddenly, as users moved from page to page, their session information was
> getting swapped with the information from another user. Every so often
> (every couple of pages or so), as you moved from one page to another, you
> suddenly wound up with the data of another user on the system.
>
>
> I then added logic so that in the unload event, it would serialize and
dump
> the entire g_Info object to disk, and the filename would be based on the
> SessionID of the user. That way I could trace the session information of
> each user as they moved from page to page. I've confirmed that this
happens
> there. It seems that when it retrieves the data from the Session object
> g_Info = Current.Session("ReservationInfo")
> it sometimes grabs the wrong data.
>
> I've analyzed several hundred page requests, and found many occurrences,
but
> can't find any pattern to it.
>
>
> I don't have a clue how this could be. Any ideas?
>
>
>
>
>



Relevant Pages

  • Re: Session data
    ... How are you storing your session information? ... server or Sql Server? ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Session Variables...
    ... The browser can affect session state information. ... These settings do not apply to the 'local intranet zone' where session information is maintained despite the options chosen here. ... Session Data Is Lost When You Use ASP.NET InProc Session State Mode ... Session Variables Are Lost If You Use FRAMESET in Internet Explorer ...
    (microsoft.public.inetserver.asp.general)
  • RE: Session expires
    ... These settings do not apply to the 'local intranet zone' where session information is maintained despite the options chosen here. ... IIS 6.0 Session State May Be Lost If You Use Web Gardens with ASP ... Session Variables Are Lost If You Use FRAMESET in Internet Explorer ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Where is HttpSession ? System.net or System.web?
    ... Persisting the Session with ASP.NET ... order for the Web server to differentiate incoming requests, ... The Web server uses this ticket to retrieve ... session information from a durable storage area. ...
    (microsoft.public.dotnet.framework)
  • Re: Where is HttpSession ? System.net or System.web?
    ... > order for the Web server to differentiate incoming requests, ... The Web server uses this ticket to ... > session information from a durable storage area. ...
    (microsoft.public.dotnet.framework)