473,698 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Variables are overwritten when another person logs in

Hello

I've created an ASP.NET page, which uses some variables which are set after
login.
When person A logs in, a new public object is instanced (i'm not sure if
that is a correct word), after which the variables are set. The problem
occurs when person B logs in at the site. After he logs in, all the
variables of person A are overwritten with the new ones.

How can I prefent this (I think a new instance need to be created every time
a person logs in).

Thank you very much.

Remco Groot Beumer
Nov 17 '05 #1
2 1423
Use session variables to store information that is specific to a given user
session.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows XP
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Remco Groot Beumer" <in**@rgbplus.n l> wrote in message
news:bo******** **@news4.tilbu1 .nb.home.nl...
Hello

I've created an ASP.NET page, which uses some variables which are set after login.
When person A logs in, a new public object is instanced (i'm not sure if
that is a correct word), after which the variables are set. The problem
occurs when person B logs in at the site. After he logs in, all the
variables of person A are overwritten with the new ones.

How can I prefent this (I think a new instance need to be created every time a person logs in).

Thank you very much.

Remco Groot Beumer

Nov 17 '05 #2
Are you storing them in an application object? If so then this would be the
behavior that would be expected becaues the Application object pool is
globally shared across the entire app (meaning there's only one instance of
any object for everyone to use). Storing things in the application session
would be better because a session is basically a sandbox for each visitor
and seperate from the other users.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Remco Groot Beumer" <in**@rgbplus.n l> wrote in message
news:bo******** **@news4.tilbu1 .nb.home.nl...
Hello

I've created an ASP.NET page, which uses some variables which are set after login.
When person A logs in, a new public object is instanced (i'm not sure if
that is a correct word), after which the variables are set. The problem
occurs when person B logs in at the site. After he logs in, all the
variables of person A are overwritten with the new ones.

How can I prefent this (I think a new instance need to be created every time a person logs in).

Thank you very much.

Remco Groot Beumer

Nov 17 '05 #3

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

Similar topics

3
874
by: Johnd | last post by:
Is there a server-side event that fires when the session variable expires that i can trap and do something with (ie renew the session Variable or say run an asp to update a database) John,
1
2780
by: Scott Lyon | last post by:
I'm maintaining (read: I didn't write it, nor do I have the time to spend to rewrite it) an application that is suddenly giving me grief. The reason I say suddenly, is because we're in the process of transitioning the server on which it runs from Microsoft Windows 2000 Server, to 2003 server (going from IIS 5 to IIS 6). This problem hasn't really occurred on the 2000 server machine, but it's happening MUCH more on the new 2003 box (not...
2
2609
by: Ekul | last post by:
I have an application that allows users to login and logout. I track how many users are logged in and when each individual is logged in. The application will not allow concurrent logins(let a user log in twice at the same time). My problem is I am having trouble telling when the user is logged off. If they click the logout button everything works fine. But if the close the browser by clicking the x or navigate to another url through the...
3
1581
by: Matt Mercer | last post by:
Hi all, I have read much about session variables and the pros and cons. I want to post my use and get opinions. When a user logs into my site various fields are pulled from a SQL user table. I store the user's name, ID, country, region, site code, and access level in session variables. I use this information to decide what fields the user can see, what he
8
2110
by: JJ | last post by:
Hi, What's the preferred way to pass variables around to different pages now? Or if my reading servers me right they are retained in memory for the life of the app, correct? How do I access these variables if in a different page than the one variable was created in? Thanks, JJ
13
1730
by: Simon Matthews | last post by:
I am having issues with the right way to architecture the following (using c# asp.net):- The question I have is how best pass the collected data from one web page for use in another. The question I have is how best pass the search criteria from the first page to the second. The search criteria exists as a structure and is filled when the user presses the 'Search' button on the first page.
9
1868
by: Mark Broadbent | last post by:
Been a while since I've touched asp.net but one thing that always seems to fustrate me is the loss of state on variable declarations. Is there anyway (i.e. assigning an attribute etc) to instruct the server to remember a variables state *without* having to go through the rigmarole of saving and loading to and from the Session state manually or similar workaround for any Types (including custom types) in exactly the same way web controls...
18
2629
by: MajorSetback | last post by:
I am using the Redhat version of Linux and GNU C++. It is not clear to me whether this is a Linux issue or a C++ issue. I do not have this problem running the same program on Windows but tweaking the C++ code appears to fix the problem on Linux. I have a static array that is declared privately in one class and a structure that is declared publicly in another class. The program uses both classes. I was getting core dumps and traced...
5
11819
by: Sandman | last post by:
I dont think I understand them. I've read the section on scope in the manual inside out. I'm running PHP 5.2.0 Here is the code I'm working on: //include_me.php <?php $MYVAR = array(); global $MYVAR, $a; ?>
0
8676
marktang
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...
0
8608
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,...
0
9164
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, 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...
0
9029
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8898
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,...
0
7734
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
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...
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.