Re: server redirect solution?

Tom Gregory
Thu, 15 Mar 2007 18:39:51 -0000

I agree that searching the response text is fragile.

Perhaps adding/checking an HTTP header would be more consistent?  You
could use X-JSON, or roll your own.


TAG

On Mar 15, 2007, at 11:55 AM, Buzzterrier wrote:

>
> Hello,
>
> We use a security app that sniffs incoming requests to make sure they
> are still authenticated. If the user needs to be re-authenticated,
> they are redirected to a login page. Upon successful authentication
> they are returned to the page of the originating request.
>
> Here is the problem, the server side redirect sends the response back
> to the httpxmlrequest, where the prototype object dutifully inserts it
> as html.  I tried capturing the on302, but for whatever reason this
> does not get called (httpliveheaders shows a 302, but it never fires
> on the browser). The cheesy hack I did was to search for some well
> known text in the response, that I know is only on the login page. If
> it exists I then do a window. location.reload(), which properly loads
> the login page.
>
> Does someone have a better implementation for this? I while what I did
> works, it just does not feel right.
>
> Thx.