当前用户被ria服务身份验证覆盖

时间:2011-04-04 08:58:32

标签: c# silverlight-4.0 forms-authentication authorization ria

我有一个SL 4应用程序,带有用于身份验证的RIA服务(Forms + IE9)。请考虑以下方案

  • 用户A登录系统
  • 现在用户B也这样做,
  • 用户A执行某些操作,看来System.Web.HttpContext.Current.User内部是用户B的隐藏凭据,这是一种灾难

这是我的web.config的一部分  <authentication mode="Forms" > <forms name="MY_COOKIE_NAME" timeout="180"/> </authentication>

和负责登录的代码部分

public AuthenticationUser Login(string userName, string password, bool isPersistent, string customData)
    { 
        var retUser = new DefaultUser();
        if (/*check credentials*/)
        {
            FormsAuthentication.SetAuthCookie(userName, true);
            retUser = CreateAuthenticatedUserData(userName);

        }
        return retUser;
    }

1 个答案:

答案 0 :(得分:0)

似乎问题在于互联网浏览器 - 永远不要在同一浏览器的两个选项卡中打开应用程序的两个实例 - 会话/ cookie /共享的任何内容

相关问题