UsreId is widely used in all kind of web applications. The question is how you can pass the userId to different location in your web application. By using Session variable? Make something like Session["UID"]=blahblahblah? Oh come on, it is 21st century already and we need something new. Session variable is a cool choice; I use it a lot before I switch to the custom MembershipProvider and the RoleProvider.
The main drawback of Session is that it can be lost due to variety reasons. Once your Session is gone, everything stored in it is gone too.
Take a quick look on this line of code.
var userName = User.Identity.Name;
Is it possible to make something like User.Identity.UserId ?
The answer is yes, and that is why we need our CustomMembershipProvider.