views:

240

answers:

3

I have read that 302 HTTP errors are not supposed to appear frequently even if you do receive one of them. the problem is they appear one out of 10 times in a page redirect in my script. Have you had any experiences with this before? I am using a PHP framework called Kohana.

+1  A: 

302 is not an error, it's used for redirecting to another resource (e.g. another page)

Waleed Eissa
+3  A: 

302 is not an error, it's a successful response, which basically means "Moved temporarily", and is quite regularly used to perform redirection in web applications.

I'm not sure what you're doing to cause 10 redirects to happen, but the fact that you're redirecting via 302 is not something to worry about, in and of itself.

timdev
here's what's happening: I click on the logout link and one time I see a page where there's only 302 HTTP and a set of header information with a link to the page the logout link is supposed to redirect to. Then I try it again and it works...wonder why I'm getting a 302 page though
Ygam
A: 

For Kohana 2.3.4, url::redirect() uses the 302 method. You may specify a different method as a second parameter in the url::redirect function. The available methods are shown in the source:

 $codes = array
 (
  'refresh' => 'Refresh',
  '300' => 'Multiple Choices',
  '301' => 'Moved Permanently',
  '302' => 'Found',
  '303' => 'See Other',
  '304' => 'Not Modified',
  '305' => 'Use Proxy',
  '307' => 'Temporary Redirect'
 );
slacker