Reputation: 167
I have used sessions in my web app.
and I sets up sessions on login with userid.
Sometimes when one user will post their problem using my web application, than entry will be there with that perticular userid and another entry also be there with any random userid.
So, multiple entries will be there in same table in sql. (this happens randomly) (this happens - when 2-3 user trying to access same thing)
Sometimes it takes any other / random userid (may be previously logged in user id) and insert data with any userid.
Sometimes one user wants to see log of his activity so he able to see another users activities or all users activities or his own activities . this one happens randomly too.
please help.
Upvotes: 2
Views: 330
Reputation: 167
If you want to use session in your asp.net web app, please do not create session using below method.
Session["username"]=usernametxt.Text;//or assign it from dataset
but use class and functions for creating session, and use get and set method for that.
set { HttpContext.Current.Session["username"] = value; }
make sure
this is just as an example.
Upvotes: 1
Reputation: 585
Are you using static class object for database transaction? this happens due to statics objects.
Upvotes: 2