I only have values and functions, the functions open and close database
connections, and the values are for user profile, such as username, accesses
(boolean), birthdate, name, office name, etc...
so what you are saying is that a Session is diferent for the
browser/client/user but only if they not in the same network?
imagine there are 3 computers in a company and all of them are using the
same version of the same browser and they are all in the web application...
how can I store such information to have it diferent for all of them?
I have the same application running in classic ASP (asp 3.0) and I never had
problems like that, of course in asp 3.0 I never used classes, only here in
asp.net 2.0.
--
Bruno Alexandre
(a Portuguese in Københanv, Danmark)
"Jason Coyne" <ga******@gmail.com> escreveu na mensagem
news:11**********************@i40g2000cwc.googlegr oups.com...
The other posters have correctly shown you how to store items in the
session or application stores. However, I must caution you that placing
a lot of objects into the session can hurt performance and scalability
quite a bit. Make sure you do not keep open expensive resources (such
as database connections) in your session variables.
Unless your object has an expensive buildup/teardown process, it is
probably better to re-instantiate the object during every page view.
I cannot stree snough the importance that you not store a database or
other "heavy" connection in your session. Make sure you follow the
principle of "aquire late, release early" in web design.
In addition to the scalability issues that session variables bring, you
also have to dael with concurernce. If the same user has multiple
browsers open, you may have one sessino shared between both browsers,
but each of the browsers wants a different instance of your object
(because they are looking at different information for example)
Bruno Alexandre wrote:
hi guys,
because asp.net class has a livetime of a active webpage (soon the user
changed the page, all the values saved in the class is lost)...
how do you manage to pass this?
my idea was in global.asax create an application session like
dim myClassVar as myClass
Application.unlock()
Applicaion("myClass") = myClassVar
Application.lock()
and then in all the pages do
dim myClassVar as new myClass
inside Page_load
myClassVar = Application("myClass")
...
any other ideias..., cause like this I can't call the apllication variable
inside a new class!
--
Bruno Alexandre
(a Portuguese in Københanv, Danmark)