Hey there. Is there any reason why redirects in my code would cause the
error:

"Redirection limit for this URL exceeded. Unable to load the requested
page. This may be caused by cookies that are blocked."

If that is whats causing the problems?

My code has been uploaded to http://rafb.net/paste/results/NcOw3L40.html
instead of filling this post up.

Any ideas please?

I just cant view any of the pages, these were working fine the other
day, and no code has been changed as far as i know.

Thanks!

Re: ASP Redirects by Advo

Advo
Tue Jul 11 19:19:49 CDT 2006

Advo wrote:
> Hey there. Is there any reason why redirects in my code would cause the
> error:
>
> "Redirection limit for this URL exceeded. Unable to load the requested
> page. This may be caused by cookies that are blocked."
>
> If that is whats causing the problems?
>
> My code has been uploaded to http://rafb.net/paste/results/NcOw3L40.html
> instead of filling this post up.
>
> Any ideas please?
>
> I just cant view any of the pages, these were working fine the other
> day, and no code has been changed as far as i know.
>
> Thanks!


I've just done a test, its definately dying when it hits one of the
redirect statements. I cant see how, or why this happens, especially
since it works fine at work??

Re: ASP Redirects by Mike

Mike
Wed Jul 12 02:34:23 CDT 2006


Advo wrote:
> Advo wrote:
> > Hey there. Is there any reason why redirects in my code would cause the
> > error:
> >
> > "Redirection limit for this URL exceeded. Unable to load the requested
> > page. This may be caused by cookies that are blocked."
> >
> > If that is whats causing the problems?
> >
> > My code has been uploaded to http://rafb.net/paste/results/NcOw3L40.html
> > instead of filling this post up.
> >
> > Any ideas please?
> >
> > I just cant view any of the pages, these were working fine the other
> > day, and no code has been changed as far as i know.
> >
> > Thanks!
>
>
> I've just done a test, its definately dying when it hits one of the
> redirect statements. I cant see how, or why this happens, especially
> since it works fine at work??

Pity you didn't post the code for the pages people are redirected to,
as my guess is that they contain redirects themselves that sends the
code into a loop. Instead of all those response.redirects, which I
guess send people to pages saying "Thanks for completing the
questionnaire" and other things like that, why don't you try replacing
the redirects with response.writes to see if this cures the problem.

--
Mike Brind


Re: ASP Redirects by Advo

Advo
Wed Jul 12 04:15:22 CDT 2006


Mike Brind wrote:
> Advo wrote:
> > Advo wrote:
> > > Hey there. Is there any reason why redirects in my code would cause the
> > > error:
> > >
> > > "Redirection limit for this URL exceeded. Unable to load the requested
> > > page. This may be caused by cookies that are blocked."
> > >
> > > If that is whats causing the problems?
> > >
> > > My code has been uploaded to http://rafb.net/paste/results/NcOw3L40.html
> > > instead of filling this post up.
> > >
> > > Any ideas please?
> > >
> > > I just cant view any of the pages, these were working fine the other
> > > day, and no code has been changed as far as i know.
> > >
> > > Thanks!
> >
> >
> > I've just done a test, its definately dying when it hits one of the
> > redirect statements. I cant see how, or why this happens, especially
> > since it works fine at work??
>
> Pity you didn't post the code for the pages people are redirected to,
> as my guess is that they contain redirects themselves that sends the
> code into a loop. Instead of all those response.redirects, which I
> guess send people to pages saying "Thanks for completing the
> questionnaire" and other things like that, why don't you try replacing
> the redirects with response.writes to see if this cures the problem.
>
> --
> Mike Brind

Mate, i think you've hit the nail on the head. Ive been checking the
code over and over, never even thought about testing the code that its
being redirected to.

Would this still occur if im running from say page1.asp which redirects
to thanks.asp once the form has submitted (this is where im getting the
error message) but surely that message would only occur, if the page
had actually got to thanks.asp and then hit the redirect loops?

Thanks


Re: ASP Redirects by Mike

Mike
Wed Jul 12 05:33:49 CDT 2006


Advo wrote:
> Mike Brind wrote:
> > Advo wrote:
> > > Advo wrote:
> > > > Hey there. Is there any reason why redirects in my code would cause the
> > > > error:
> > > >
> > > > "Redirection limit for this URL exceeded. Unable to load the requested
> > > > page. This may be caused by cookies that are blocked."
> > > >
> > > > If that is whats causing the problems?
> > > >
> > > > My code has been uploaded to http://rafb.net/paste/results/NcOw3L40.html
> > > > instead of filling this post up.
> > > >
> > > > Any ideas please?
> > > >
> > > > I just cant view any of the pages, these were working fine the other
> > > > day, and no code has been changed as far as i know.
> > > >
> > > > Thanks!
> > >
> > >
> > > I've just done a test, its definately dying when it hits one of the
> > > redirect statements. I cant see how, or why this happens, especially
> > > since it works fine at work??
> >
> > Pity you didn't post the code for the pages people are redirected to,
> > as my guess is that they contain redirects themselves that sends the
> > code into a loop. Instead of all those response.redirects, which I
> > guess send people to pages saying "Thanks for completing the
> > questionnaire" and other things like that, why don't you try replacing
> > the redirects with response.writes to see if this cures the problem.
> >
> > --
> > Mike Brind
>
> Mate, i think you've hit the nail on the head. Ive been checking the
> code over and over, never even thought about testing the code that its
> being redirected to.
>
> Would this still occur if im running from say page1.asp which redirects
> to thanks.asp once the form has submitted (this is where im getting the
> error message) but surely that message would only occur, if the page
> had actually got to thanks.asp and then hit the redirect loops?
>
> Thanks

I don't quite understand your question. As an example, say page1.asp
contains a redirect on succesful completion of a form to page2.asp. On
page2.asp you have some code checking for a flag (session variable,
querystring value, cookie etc) that the person has successfully
completed the form and not arrived there by accident. If it's not set,
you redirect them to page1.asp to complete the form. However some code
on page1.asp rules that a condition under which a redirect to page2.asp
is necessary is true, and sends the visitor back to page2.asp etc. And
on it goes until the browser decides it's had enough.

So, you need to check all your conditions on all pages, or start off
with this first one by taking up my initial suggestion and replace
redirects with response.writes to see which ones fire unexpectedly, and
under what conditions.

By the way, the best way to solve this kind of problem is to have all
your code in one page, with the form posting back to itself.

--
Mike Brind


Re: ASP Redirects by Advo

Advo
Wed Jul 12 05:55:37 CDT 2006


Mike Brind wrote:
> Advo wrote:
> > Mike Brind wrote:
> > > Advo wrote:
> > > > Advo wrote:
> > > > > Hey there. Is there any reason why redirects in my code would cause the
> > > > > error:
> > > > >
> > > > > "Redirection limit for this URL exceeded. Unable to load the requested
> > > > > page. This may be caused by cookies that are blocked."
> > > > >
> > > > > If that is whats causing the problems?
> > > > >
> > > > > My code has been uploaded to http://rafb.net/paste/results/NcOw3L40.html
> > > > > instead of filling this post up.
> > > > >
> > > > > Any ideas please?
> > > > >
> > > > > I just cant view any of the pages, these were working fine the other
> > > > > day, and no code has been changed as far as i know.
> > > > >
> > > > > Thanks!
> > > >
> > > >
> > > > I've just done a test, its definately dying when it hits one of the
> > > > redirect statements. I cant see how, or why this happens, especially
> > > > since it works fine at work??
> > >
> > > Pity you didn't post the code for the pages people are redirected to,
> > > as my guess is that they contain redirects themselves that sends the
> > > code into a loop. Instead of all those response.redirects, which I
> > > guess send people to pages saying "Thanks for completing the
> > > questionnaire" and other things like that, why don't you try replacing
> > > the redirects with response.writes to see if this cures the problem.
> > >
> > > --
> > > Mike Brind
> >
> > Mate, i think you've hit the nail on the head. Ive been checking the
> > code over and over, never even thought about testing the code that its
> > being redirected to.
> >
> > Would this still occur if im running from say page1.asp which redirects
> > to thanks.asp once the form has submitted (this is where im getting the
> > error message) but surely that message would only occur, if the page
> > had actually got to thanks.asp and then hit the redirect loops?
> >
> > Thanks
>
> I don't quite understand your question. As an example, say page1.asp
> contains a redirect on succesful completion of a form to page2.asp. On
> page2.asp you have some code checking for a flag (session variable,
> querystring value, cookie etc) that the person has successfully
> completed the form and not arrived there by accident. If it's not set,
> you redirect them to page1.asp to complete the form. However some code
> on page1.asp rules that a condition under which a redirect to page2.asp
> is necessary is true, and sends the visitor back to page2.asp etc. And
> on it goes until the browser decides it's had enough.
>
> So, you need to check all your conditions on all pages, or start off
> with this first one by taking up my initial suggestion and replace
> redirects with response.writes to see which ones fire unexpectedly, and
> under what conditions.
>
> By the way, the best way to solve this kind of problem is to have all
> your code in one page, with the form posting back to itself.
>
> --
> Mike Brind




I think the problem is down to the fact that on my thanks.asp page,
there was some existing code that was searching for a customerid string
(?customerid=.....)

but, because my main page was only redirecting to thanks.asp AS IT
SHOULD, there was no need for this code in there.

Am i right in thinking..

My main page was fine, the user completes the questionnaire and is
taken to thanks.asp but on thanks.asp it is waiting for that customerid
string (which it will never get) so then, because there is no customer
id form they are being taken to noquestionnaire.asp which also
contained that same code. noquestionnaire.asp is also waiting for a
customerid, which it wont get, so again this is taking them to
noquestionnaire.asp where it hits the loop again.

I think this is the main problem, and Mike i thank you for making me
see and fix the error.

It was working like:

Mainpage.asp -> thanks.asp -> noquestionnaire.asp (waits for custid -
false) -> noquestionnaire.asp (waits for custid - false) ->
noquestionnaire.asp and so forth. This is where i feel my indefinate
loop occured. This has now been rectified.!