Enable cross app redirects
- by Gogster
Hi all,
We have load balancing set up on out two web server, however, a few users are being asked to login when they are being re-directed to a particular server to upload a document (we are trying to keep all uploaded documents on one server only), here is the code from 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="7B4EC5B0C83631DF25D5B179EDDBF91B1C175B81C6F52102267D3D097FBF272A"
validationKey="7D1F50788629CC342EE4985D85DE3D14F10654695912C0FFD439F54BED64F76A57A2D5E8180BC6FF052E0385C30558F5527D6C197C577A7F32DD8FF1CAC9F794" />
Here is the transfer code to the upload form:
$('#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 = "http://eaa.cms.necinteractive.net/members/media-upload" + String.Format("?{0}={1}", cookieName, cookieValue);
}
</script>
<iframe id="iframeUploadReport" src="http://eaa.cms.necinteractive.net/members/media-upload" width="500px" height="336px" frameborder="0" scrolling="no"></iframe>
Can you see any obvious step we are missing?
Thanks