/** * Constructor * @param \Slim\Environment $env */ public function __construct(\Slim\Environment $env) { $this->env = $env; $this->headers = new \Slim\Http\Headers(\Slim\Http\Headers::extract($env)); $this->cookies = new \Slim\Helper\Set(\Slim\Http\Util::parseCookieHeader($env['HTTP_COOKIE'])); }
public function testPrefersLeftmostCookieWhenManyCookiesWithSameName() { $header = 'foo=bar; foo=beer'; $result = \Slim\Http\Util::parseCookieHeader($header); $this->assertEquals('bar', $result['foo']); }