views:

43

answers:

0

We recently deployed a new ASP MVC application to our live environment but have been experiencing intermittent issues with users logged sessions.

After a lot of logging etc we finally saw the error to be that:

User.Identity.Name returns a comma separated list of all the particular users logged in sessions. We do have other asp based sites where the user needs to login.

I.e. User.Identity.Name will return something like:

username1,random_user,8f52f48a-1e14-47a4-9706-74011041df72

Which then causes Membership.GetUser to throw an exception as it expects a single string and not a comma separated one.

My question is why does User.Identity.Name return all logged in session's usernames?

Will:

HttpContext.User.Identity.Name

OR

this.User.Identity.Name

Perhaps return the current application's username and not all them globally?

related questions