User Sessions Override each other [Resolved]

Posted by Vuyiswamb under ASP.NET AJAX on 10/21/2014 | Points: 10 | Views : 1397 | Status : [Member] [MVP] [Administrator] | Replies : 2
Good Day All

I hope someone can help me. i have a Asp.net web application that is running on 4.51 , When the User login Successfully i return an Object that has info for that user and store this in a Static object. Now my problem is the i

User 1 Login (Welcome James)

and

User 2 Login (WelCome Daniel)

and User 1 refreshes the Page (Welcome Daniel)

My user sessions override each other. i did mess around with the IIS Session before , i just noticed this now. Can anyone help.

Thanks

Thank you for posting at Dotnetfunda
[Administrator]



Responses

Posted by: Sheonarayan on: 10/21/2014 [Administrator] HonoraryPlatinum | Points: 50

Up
0
Down

Resolved
Static object has only one instance as the name suggests. You may use normal variables or session.

The best way to implement authentication in asp.net is using FormsAuthentication. Please search about it in this website.

Answering from mobile...



Regards,
Sheo Narayan
http://www.dotnetfunda.com

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 10/22/2014 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Lucky it was not in many places. so i changed the Static Objects to Session . i think i got comfortable with Silverlight model of Dev that uses Cookies and Static objects. All is resolved.

Thanks

Thank you for posting at Dotnetfunda
[Administrator]

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response