Response buffering/flushing may play in here. Any reason you couldn't
also look at writing a javascript redirect to the page if need-be?

I have to say, I've never acted on a Response after redirecting ... I
didn't know you could work with it like that.

∞ Andy Badera
∞ +1 518-641-1280
∞ This email is: [ ] bloggable [x] ask first [ ] private
∞ Google me: http://www.google.com/search?q=andrew%20badera



On Tue, Sep 8, 2009 at 12:03 PM, B-Dub<[email protected]> wrote:
>
> I have a problem that has been baffling me for several days now and
> could use some help.
>
> Here is the summary:  I have a asp.net page, "Int1.aspx" that needs to
> redirect the user to an external page, "Ext1.html."  Ext1.html needs
> to finish loading and write a client-side cookie that authenticates
> that user on the external site.  Once Ext1.html is finished loading
> and writing the cookie, then Int1.aspx needs to detect this and do
> another redirect to a second external page, "Ext2.html"
>
> Use Case:
> - On internal site, user clicks on an article link that points to an
> external partner site
> - The user is automatically authenticated on the external website in
> the background
> - The external article loads and page does not include a login form
> (User has done this all in one click)
>
>
> Here is some sample code that I have written that tries to accomplish
> this.
>
>           string redirectLinkExt1 = "https://externalsite.com/
> seamless/Ext1.html";
>           string redirectArticleLinkExt2 = "http://externalsite.com/
> Ext2.html";
>
>            try
>            {
>
>                Response.Redirect(redirectLinkExt1 , false);
>
>                switch (Response.StatusCode)
>                {
>
>                       case 302:
>
>                        Response.Redirect(redirectArticleLinkExt2 ,
> false);
>
>                        break;
>
>                    default:
>                        break;
>                }
>            }
>
>            finally
>            {
>
>            }
>
> The obvious problem I am running into is that when I redirect to
> redirectArticleLinkExt2 (Ext2.html) the first external page
> (Ext1.html) has not had time to load and write the cookie on the
> client.  So, by the time Ext2.html is loaded the page is loaded but
> the user is not authenticated.
>
> How can I achieve this "wait until cookie is written" behavior?  Keep
> in mind that the external site is not one that I have any control
> over, but is a partner site.  Thanks in advance for any ideas.
>

Reply via email to