I’m using ASP.NET MVC 3. When a user logs in to my website application and a cookie is stored, the user name is being stored in the case that it was entered in.
For instance, in my database the username is “SomeUser”. If the user logs in as “someuser”, that is what is stored (and displayed) is “someuser”, instead of “SomeUser”. If you enter “SOMEUSER”, it is stored/displayed as “SOMEUSER”.
Why is this happening? I don’t remember this ever being an issue. Any workaround to this so that if the user enters “someuser”, it is stored/displayed as “SomeUser”?
Since MVC doesn’t store the cookie itself, you might want to look at your code that does the user validation and sets the cookie. You are likely storing the username as entered by the user, rather than using the username as returned by the Membership API.
Otherwise, .NET has no way of knowing what the case should be. The only way it can know is by comparing it to the casing in the Membership system.