Zend Framework

Zend Http Client Redirect header

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.5
  • Fix Version/s: None
  • Component/s: Zend_Http_Client
  • Labels:
    None

Description

When we use Zend_Http_Client to request a page, usually, it look at the response header, find if there any redirect header like 'Location: abc.com' then forward the connection to new location.

But there some site that they're not only redirect to a new location but also set the cookie to track the redirection. If cookies is not match, then the new location output is very different from the matching cookie one. Currently, Zend_Http_Client is just forward to the new location but do nothing about the cookie.

So i recommend that before redirect to new location, Zend_Http_Client must read in the response header. If there're any 'Set-Cookie' header, then it must set the cookie header to the new location request header.

Example url that have both redirection header and set-cookie header:
http://www.oocl.com/oocl/Includes/eLink/ExpressLink.aspx?eltype=ct&bl_no=&cont_no=OOLU6022600

Activity

Hide
Shahar Evron added a comment -

Please read the docs about Zend_Http_Cookiejar (http://files.zend.com/help/Zend-Framework/zend.http.cookies.html).

It's fairly easy to use and does exactly what you are looking for.

Show
Shahar Evron added a comment - Please read the docs about Zend_Http_Cookiejar (http://files.zend.com/help/Zend-Framework/zend.http.cookies.html). It's fairly easy to use and does exactly what you are looking for.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: