473,399 Members | 3,919 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,399 software developers and data experts.

Problem in Fetching Session Variable

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 snippe

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 issu

Thanking you in advance

Regard
Phanidha


Nov 18 '05 #1
1 766
be sure you are not storing the session reference in a static

-- bruce (sqlwork.com)
"Phanidhar" <an*******@discussions.microsoft.com> wrote in message
news:9A**********************************@microsof t.com...
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

Nov 18 '05 #2

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

Similar topics

0
by: Bob | last post by:
I have an ASP.NET web application that has been running without any problems for a while. I recently transferred the site to shared hosting and had multiple users start to use the site. The problem...
1
by: farooqazeem | last post by:
Hi guys, I’m facing some problem can u solve it. Problem is: I’m giving user Id and password in (Login_sess.asp) and submit it to page (sess_test.asp). I am setting session variable...
8
by: Jack | last post by:
Hi, Here is my problem: I am logging in to a page, where the page retrieves a record from a database. The text boxes are used in the display formto let the users update the fields, if they...
1
by: Phanidhar | last post by:
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...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
4
by: N. Demos | last post by:
Hello, I'm learning ASP.NET, and am having a strange problem with some example code from the book I'm using. The code increments and displays the value stored in a session variable when the "Add"...
0
by: Shujun Huang | last post by:
Hi, I am working on converting Informix database to Postgre. I have one question for fetching records using PostgreSQL. The record I am fetching is a variable size text string. Before fetching...
22
by: Sandman | last post by:
So, I have this content management system I've developed myself. The system has a solid community part where members can register and then participate in forums, write weblogs and a ton of other...
1
by: hesameagle | last post by:
Hi I want to use ajax to connect to database and echo some data in my page, I wrote these two codes that can handle my need: index.php ----------------------------------------- <?php ...
1
nitindel
by: nitindel | last post by:
Hi All, Please tell me any good site for Gridview control.(not for datagrid). I am facing error in fetching the values of the Bound columns in the gridview: lease tell me how should i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
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...

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.