|
From: SourceForge.net <no...@so...> - 2011-08-03 09:43:47
|
Bugs item #3385457, was opened at 2011-08-03 09:43 Message generated for change (Tracker Item Submitted) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=547455&aid=3385457&group_id=76550 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Web tester Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: transkontrol () Assigned to: Marcus Baker (lastcraft) Summary: invalid cookie host on redirect page Initial Comment: If site answer redirect to another site, and set new cookie, then this new cookie set for second site. For example, virtual dialog: > GET / Host: site1.org < HTTP/1.1 302 Found Server: nginx/0.9.3 Date: Wed, 03 Aug 2011 09:35:26 GMT Set-Cookie: kykypyky=123; expires=Tue, 03-Aug-2010 09:35:25 GMT; path=/ Location: http://site2.net/ > GET / Host: site2.net Cookie: kykypyky=123 //<- new cookie this < HTTP/1.1 302 Found Location: http://site1.org/abc/ > GET / abc/ Host: site1.org //No cookie... Simple solution this problem: $ svn diff Index: user_agent.php =================================================================== --- user_agent.php (revision 2036) +++ user_agent.php (working copy) @@ -244,14 +244,14 @@ return $response; } $headers = $response->getHeaders(); - $location = new SimpleUrl($headers->getLocation()); - $url = $location->makeAbsolute($url); if ($this->cookies_enabled) { $headers->writeCookiesToJar($this->cookie_jar, $url); } if (! $headers->isRedirect()) { break; } + $location = new SimpleUrl($headers->getLocation()); + $url = $location->makeAbsolute($url); $encoding = new SimpleGetEncoding(); } while (! $this->isTooManyRedirects(++$redirects)); return $response; ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=547455&aid=3385457&group_id=76550 |