Last post Mar 24, 2010 07:03 AM by renjithrajan88
Mar 19, 2010 03:14 AM|ahjeck|LINK
Hi, I have a web app which people online create new applications for a survey. We also accept paper applications, where in those cases we would enter the application on behalf of them, through the web app. There is a registration/login functionality for
users to save their survey and come back at another time.
Our 'special account' that we use for paper apps are shared among multiple volunteers (users) where simuotaneous logins often occur (w/ the same account). It so happens that there is a session variable that stores the current app's ID. The problem I'm having
is that for any given time that an app is being entered and another app being viewed, sometimes the app being entered overwrites the app being viewed.
My understanding for session variables are that they are not shared and pertained through each session. So my question is, is this the case when we are using the same login credentials, but with different workstations??? If not, is there any other possible
reason why my AppID session variable may be overwriting through different users/sessions.
Below is some code on a button that generates a new app record and the gridview button that 'view's the app.
session variable shared
Mar 19, 2010 12:19 PM|Aquaren|LINK
You could user Application instead of Session to store your application wide variables. This is available to all sessions.
Mar 19, 2010 07:43 PM|ahjeck|LINK
Thanks for the reply aquaren,
The problem is that I do not want shared variables. In some cases, it appears as if the "AppID" session variable is being shared among users (logged in with same credentials/account; login is done through .net's Profiling feature w/ aspnetdb database). So
when User A goes to creating a new app and then User B views an existing one, User A all of a sudden gets populated with User B's viewed app. Creepy!
No static variables are used in this app.
It appears as if the session variables are shared even though each user has its own session opened (via different workstations). Only thing similar is that they are using the same credentials/account to log in.
What could be happening to the session variables??
Mar 24, 2010 06:46 AM|Bober Song - MSFT|LINK
Hi ahjeck ,
The Session object is based on the single user, so I think you can't share Session object with some users.
If you want to share some data, you can use the Cache object.
I hope it is helpful to you.
Mar 24, 2010 07:03 AM|renjithrajan88|LINK
i agree to Bober Song
session is created whenever a new instance of the app is intitiated from the server.
u can try it in single system itself. run ur app in firefox and chrome or any other browser. the session wil be different for both