Problem in Fetching Session Variable

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Phanidhar (anonymous_at_discussions.microsoft.com)
Date: 04/01/04


Date: Thu, 1 Apr 2004 08:51:13 -0800

Hi,
  We are developing an ASP.NET application is being accessed by multiple users simultaneously. We are facing a problem in retrieving the ASP.NET session of the logged on users correctly. Let me explain u using a code snippet

  string strUsername = Session["User"];
  Session objSession = GetSession(strUsername);

 The above code is executed in almost all pages to fetch the user session.
 When mutilple users are simulteneoulsy accessing the application, the user name retrieved from the Session is not for the current user but for someother user who is currently logged on to the system.

   For example, if users user1,user2, and user3 are currently logged into the system, and if I try to retrieve the APS.NET session variable for user 'user1', I sometimes get the session of either user2 or user3. This is also not consistent. If i refresh this problem is NOT observed. So in the above code snippet when i'm expecting to retrieve the session username of 'user1' using 'Session["Username"]', I get the value as either 'user2' or 'user3'.

  I'm not able to figure out this problem. It'll be great if someone can help in resolving the issue

  Thanking you in advance.

Regards
Phanidhar

 

 



Relevant Pages

  • Re: Session object gone!
    ... Are you sure you're retrieving any data? ... If you retrive Nothing, and store ... it in Session, you will get the result you've described. ... > When I return to the calling routine my Session object is gone!! ...
    (microsoft.public.dotnet.framework.aspnet)
  • Idle time in a T.S. session - how to get it?
    ... allow for the idle time for a session to be retrieved. ... Terminal Services Manager is capable of retrieving & displaying this ... Is there an undocumented information class that can be used to obtain this ... Chuck Chopp ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Delay in IMAPIAdviseSink::onNotify
    ... Do you share the session by calling MAPILogonEx or by retrieving ... Did you try to cause an RPC by retrieving PT_TEST_LINE_SPEED property from ... Do you mean "delay", ie your OnNotify method gets called some time after ... So that I have some question: Is it stupid to combine MAPI calls and OOM ...
    (microsoft.public.win32.programmer.messaging)
  • Re: Session object gone!
    ... > Are you sure you're retrieving any data? ... If you retrive Nothing, and store ... > it in Session, you will get the result you've described. ... >> When I return to the calling routine my Session object is gone!! ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How secure are session variables?
    ... session variables are not something people can get ... pull it out as you need it, retrieving it each time from scratch. ... However this still isn't secure ...
    (microsoft.public.dotnet.framework.aspnet)