Why do I need to pass a username to this method? I just want the url that was redirected from for 开发者_如何学运维forms authentication...
FormsAuthentication.GetRedirectUrl
I don't understand why it needs it either. If you look at the source code, it simply does a null check. If the value of userName
is null, it skips out and returns null. If there is any non-null value, it proceeds, but still completely ignores the value. It has nothing to do with the processing at all.
Also note that createPersistentCookie
is ignored, both per the MS documentation as well as is evident in the code.
Most probably the .NET framework needs to know which user was redirected. Remember server side there are multiple users accessing the same application.
If you really want to know, use reflector to check out System.Web.Security.
精彩评论