Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 启用跨应用程序重定向_Asp.net_Authentication_Membership_Umbraco - Fatal编程技术网

Asp.net 启用跨应用程序重定向

Asp.net 启用跨应用程序重定向,asp.net,authentication,membership,umbraco,Asp.net,Authentication,Membership,Umbraco,我们在两台web服务器上设置了负载平衡,但是,当一些用户被重新定向到特定服务器以上载文档时,他们会被要求登录(我们尝试将所有上载的文档仅保留在一台服务器上),下面是web.config中的代码: <authentication mode="Forms"> <forms name="EAAAuthCookie" loginUrl="/login" defaultUrl="/members/home" protection="All"

我们在两台web服务器上设置了负载平衡,但是,当一些用户被重新定向到特定服务器以上载文档时,他们会被要求登录(我们尝试将所有上载的文档仅保留在一台服务器上),下面是web.config中的代码:

<authentication mode="Forms">
    <forms name="EAAAuthCookie" 
    loginUrl="/login" 
    defaultUrl="/members/home" 
    protection="All" 
    path="/" 
    timeout="60000" 
    slidingExpiration="true"
    enableCrossAppRedirects="true" />
</authentication>

<machineKey
decryption="AES"
validation="SHA1"
decryptionKey="key"
validationKey="key" />

以下是上传表单的传输代码:

$('#addReport').click(function() {
            if ($.cookie('TransferURL') != '')
            {
                $("#iframeUploadReport").attr('src', $.cookie('TransferURL'));
            };

            $('#overlay').fadeIn('slow');
        });

<script type="text/C#" runat="server">
    void Page_Load()
    {
        string cookieName = FormsAuthentication.FormsCookieName;
        string userName = Request.Cookies["HiddenUsername"].ToString();
        string cookieValue = FormsAuthentication.GetAuthCookie(userName, false).Value;
        Response.Cookies["TransferURL"].Value = "/members/media-upload" + String.Format("?{0}={1}", cookieName, cookieValue);
    }
</script>

<iframe id="iframeUploadReport" src="/members/media-upload" width="500px" height="336px" frameborder="0" scrolling="no"></iframe>
$('#addReport')。单击(函数(){
if($.cookie('TransferURL')!=“”)
{
$(“#iframeUploadReport”).attr('src',$.cookie('TransferURL');
};
$('#overlay').fadeIn('slow');
});
无效页面加载()
{
字符串cookieName=FormsAuthentication.FormsCookieName;
字符串userName=Request.Cookies[“HiddenUsername”].ToString();
字符串cookieValue=FormsAuthentication.GetAuthCookie(用户名,false).Value;
Response.Cookies[“TransferURL”].Value=“/members/media upload”+String.Format(“?{0}={1}”,cookieName,cookieValue);
}
你能看到我们缺少的任何明显的步骤吗

谢谢

请参阅

要使表单身份验证在负载平衡的环境中工作,需要使两个应用程序使用相同的机器密钥。只需按照链接中的说明操作即可