Hello. In my web application, when i debugging, all users share the same session.
This is my login page. I need every user to have his own session, what should i do? Now, when i am logging on a broset, login with new user, set somenting and open the site in another browser, i can see what i have done in first browser :(
Session.Abandon();
var customer = Query.GetCustomer(txtEmail.Text);
if (customer == null)
{
lblError.Visible = true;
}
else
{
if (PasswordEncrypt.IsValidPassword(txtPassword.Text, EncryptedPassword, Salt))
I explained myself wrong. Not the same sessions, the same data from my application. I have userID, first when is logged in, the userID become the userID, when the second user log in the userID becomes userID2, and the first user use userID2.
Yep, again... sounds like a page caching issue. Are you doing any explicit page caching? Also, since you have users that are authenticated you should be using SSL and that will disable server caching for those requests (which might be the issue). Are you
currently using SSL?
seiko88
Member
41 Points
91 Posts
All users share same session
Apr 11, 2012 02:06 PM|LINK
Hello. In my web application, when i debugging, all users share the same session.
This is my login page. I need every user to have his own session, what should i do? Now, when i am logging on a broset, login with new user, set somenting and open the site in another browser, i can see what i have done in first browser :(
Session.Abandon();
var customer = Query.GetCustomer(txtEmail.Text);
if (customer == null)
{
lblError.Visible = true;
}
else
{
if (PasswordEncrypt.IsValidPassword(txtPassword.Text, EncryptedPassword, Salt))
{
WebOrder.Instance.SetCustomer(customer);
Response.Redirect("/Order-Type");
}
else
{
lblError.Visible = true;
}
}
Thank you!
ramanselva
Contributor
2064 Points
324 Posts
Re: All users share same session
Apr 11, 2012 02:28 PM|LINK
Hi,
Can you check are you creating any cookies in client end like Remember Me by default..
This can be beneficial to other community members reading the thread.
Regards,
Rama Selvam M.
seiko88
Member
41 Points
91 Posts
Re: All users share same session
Apr 11, 2012 02:36 PM|LINK
All is clear. I deleted all datas from both browsers, rebuild the application, but the problem still exist
BrockAllen
All-Star
28072 Points
4996 Posts
MVP
Re: All users share same session
Apr 11, 2012 03:29 PM|LINK
If you have different users seeing the same session (and thus the same data in the HTML) then it might be because the pages are being cached.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
seiko88
Member
41 Points
91 Posts
Re: All users share same session
Apr 11, 2012 03:54 PM|LINK
I explained myself wrong. Not the same sessions, the same data from my application. I have userID, first when is logged in, the userID become the userID, when the second user log in the userID becomes userID2, and the first user use userID2.
BrockAllen
All-Star
28072 Points
4996 Posts
MVP
Re: All users share same session
Apr 11, 2012 03:59 PM|LINK
Yep, again... sounds like a page caching issue. Are you doing any explicit page caching? Also, since you have users that are authenticated you should be using SSL and that will disable server caching for those requests (which might be the issue). Are you currently using SSL?
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
seiko88
Member
41 Points
91 Posts
Re: All users share same session
Apr 11, 2012 04:28 PM|LINK
I dont have explicit caching and i am using SSL. One day lost to a stupid problem and no solution yet...
BrockAllen
All-Star
28072 Points
4996 Posts
MVP
Re: All users share same session
Apr 11, 2012 04:36 PM|LINK
Well, the the only other thing I can think of is this line of code:
WebOrder.Instance.SetCustomer(customer);
Is that a static/global instance? If so, then all HTTP requests are using that same instance and thus accidently getting the same "logged in" user.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
seiko88
Member
41 Points
91 Posts
Re: All users share same session
Apr 11, 2012 04:40 PM|LINK
Is global.
public class WebOrder
Thanks for you time :)
BrockAllen
All-Star
28072 Points
4996 Posts
MVP
Re: All users share same session
Apr 11, 2012 04:43 PM|LINK
So that was the problem?
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/