Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Variables and Multiple Users Simultaneously Same Script 1

Status
Not open for further replies.

snakehips2000

Programmer
Nov 10, 2003
95
GB
There's probably something basic I'm missing here but, if my ASP page contains the following:
Code:
<%
	rsProducts.Close
	Set rsProducts = Nothing

	objConnection.Close
	Set objConnection = Nothing
%>
If User 1 runs the page and, whilst executing and having set the recordset and connection object variables, User 2 starts to run the same script, will User 2 be impacted once the above code is reached by User 1?

In other words, are the above object variables set at application level or at script level (thereby allowing each user to have their own set of rsProducts and objConnection variables)?

Thanks and hope that makes sense.
Brian
 
User 2 starts to run the same script, will User 2 be impacted once the above code is reached by User 1?
No each running version of the script runs in it's own application space in memory.

"Application" level and script level are one and the same thing, they are isolated and independent of each other.

Even if you had two browser tabs/windows on the same machine open on the same page the variables and objects would not be "shared" or available cross session.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Having experimented a bit on this, I opened two separate instances of IE (not two tabs within the same instance) on the same machine and accessed my site via two different login IDs. Behind the login script there is a piece of code which sets the session("username") value.

So, in IE instance 1, I login as "User1" and in IE instance 2 I login as "User2". Now, based on the logic you quoted in your earlier response, I was expecting to be able to navigate from script to script in each instance and retain the unique Session("username") value in each instance.

However, what seems to happen is that, after logging in as User2 and then the refreshing (F5) IE instance 1, the Session("username") value has been overwritten from "User1" to "User2".

Maybe again it's me misunderstanding the basics of ASP but this doesn't seem like two IE instances operating independently if one instance can overwrite session variables in the other?
 
that is because session and cookie data on the CLIENT MACHINE is availabe to each browser instance on the same machine.
Thats how Amazon, eBay or this very forum 'knows' who you are when you revisit.

It is nothing to do with server script isolation.

Try it with two DIFFERENT browsers or with a script that doesn't store sessions or cookies

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top