开发者

FormsAuthentication.GetRedirectUrl needs a username

开发者 https://www.devze.com 2023-01-14 18:06 出处:网络
Why do I need to pass a username to this method?I just want the url that was redirected from for 开发者_如何学运维forms authentication...

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消