Skip to content
Permalink
Browse files

fix cookie expire value from CsrfComponent not used

CsrfComponent uses key 'expiry' while Network\Response uses 'expire'
  • Loading branch information...
Schlaefer committed Jun 25, 2015
1 parent 25d6753 commit 22dae85691228e0174f6abad818992419b84397f
@@ -125,7 +125,7 @@ protected function _setCookie(Request $request, Response $response)
$response->cookie([
'name' => $this->_config['cookieName'],
'value' => $value,
'expiry' => $this->_config['expiry'],
'expire' => $this->_config['expiry'],
'path' => $request->webroot,
'secure' => $this->_config['secure'],
]);
@@ -72,7 +72,7 @@ public function testSettingCookie()
$cookie = $controller->response->cookie('csrfToken');
$this->assertNotEmpty($cookie, 'Should set a token.');
$this->assertRegExp('/^[a-f0-9]+$/', $cookie['value'], 'Should look like a hash.');
$this->assertEquals(0, $cookie['expiry'], 'session duration.');
$this->assertEquals(0, $cookie['expire'], 'session duration.');
$this->assertEquals('/dir/', $cookie['path'], 'session path.');
$this->assertEquals($cookie['value'], $controller->request->params['_csrfToken']);
@@ -273,7 +273,7 @@ public function testConfigurationCookieCreate()
$cookie = $controller->response->cookie('token');
$this->assertNotEmpty($cookie, 'Should set a token.');
$this->assertRegExp('/^[a-f0-9]+$/', $cookie['value'], 'Should look like a hash.');
$this->assertEquals(90, $cookie['expiry'], 'session duration.');
$this->assertEquals(90, $cookie['expire'], 'session duration.');
$this->assertEquals('/dir/', $cookie['path'], 'session path.');
$this->assertTrue($cookie['secure'], 'cookie security flag missing');
}

0 comments on commit 22dae85

Please sign in to comment.
You can’t perform that action at this time.