开发者

FormsAuthentication: Whats the difference between Request.ServerVariables("AUTH_USER") and User.Identity.Name?

开发者 https://www.devze.com 2023-02-20 19:44 出处:网络
I have a开发者_Go百科 feeling that Request.ServerVariables(\"AUTH_USER\") and User.Identity.Name return the same string while using FormsAuthentication.

I have a开发者_Go百科 feeling that Request.ServerVariables("AUTH_USER") and User.Identity.Name return the same string while using FormsAuthentication.

So my question is as simple as that. Which one should i better use?


They return the same value indeed, the ServerVariables is there only for backward compatibility with legacy code. Normally you should user User.Identity.Name.

0

精彩评论

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