Click here to Skip to main content
15,885,842 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I created an asp.net mvc4 application and depolyed it successfully in server.

When I login into the deployed web application its working fine, but when different user login from different device with their own credential,by surprise my page is visible to them. They cant access their profile instead of that my profile details are displaying to them.

Once after I logged out they can view their pages and its happening vice versa.

I am dumping my head to figure out the problem. I pasted the controller and view code below.
C#
Controller.cs

[HttpPost]
        public ActionResult LogIn(ECusertables user,int id=0)
        {
            
                if (IsValid(user.Email, user.Password))
                {
                    user = db.ECusertables.Where(u => u.Email == user.Email).Select(i => i).FirstOrDefault();
FormsAuthentication.SetAuthCookie(user.Email, false);
}
}

View.Cshtml

 @if (Request.IsAuthenticated)
        {
            <div align="right" style="margin-removed10px;">  @Html.Encode(User.Identity.Name) 
            </div>
        }



Thanks in adavnce.
Posted
Updated 22-Dec-13 23:07pm
v3
Comments
Er. Tushar Srivastava 23-Dec-13 4:50am    
Obviously its some logic error. You have to post some (not whole) possibly faulty code snippet to help someone who may answer you. I guess your login script or session manager has some fault. Try to review it and if you find the culprit you are good else you should post some code snippet here using Improve Question Link.

1 solution

I can't judge exactly because of lack of code. Bur most possible reason, that you pass static variable as user parameter into your login method
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900