CookieTest.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Http_Cookie
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. require_once dirname(__FILE__) . '/../../TestHelper.php';
  23. require_once 'Zend/Http/Cookie.php';
  24. /**
  25. * Zend_Http_Cookie unit tests
  26. *
  27. * @category Zend
  28. * @package Zend_Http_Cookie
  29. * @subpackage UnitTests
  30. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  31. * @license http://framework.zend.com/license/new-bsd New BSD License
  32. * @group Zend_Http
  33. * @group Zend_Http_Cookie
  34. */
  35. class Zend_Http_CookieTest extends PHPUnit_Framework_TestCase
  36. {
  37. /**
  38. * Cookie creation and data accessors tests
  39. */
  40. /**
  41. * Make sure we can't set invalid names
  42. *
  43. * @dataProvider invalidCookieNameCharProvider
  44. * @expectedException Zend_Http_Exception
  45. */
  46. public function testSetInvalidName($char)
  47. {
  48. $cookie = new Zend_Http_Cookie("cookie_$char", 'foo', 'example.com');
  49. }
  50. /**
  51. * Test we get the cookie name properly
  52. *
  53. * @dataProvider validCookieWithInfoProvider
  54. */
  55. public function testGetName($cStr, $cInfo)
  56. {
  57. $cookie = Zend_Http_Cookie::fromString($cStr);
  58. if (! $cookie instanceof Zend_Http_Cookie) {
  59. $this->fail("Failed creating a cookie object from '$cStr'");
  60. }
  61. if (isset($cInfo['name'])) {
  62. $this->assertEquals($cInfo['name'], $cookie->getName());
  63. }
  64. }
  65. /**
  66. * Make sure we get the correct value if it was set through the constructor
  67. *
  68. * @param string $value
  69. * @dataProvider validCookieValueProvider
  70. */
  71. public function testGetValueConstructor($val)
  72. {
  73. $cookie = new Zend_Http_Cookie('cookie', $val, 'example.com', time(), '/', true);
  74. $this->assertEquals($val, $cookie->getValue());
  75. }
  76. /**
  77. * Make sure we get the correct value if it was set through fromString()
  78. *
  79. * @param string $value
  80. * @dataProvider validCookieValueProvider
  81. */
  82. public function testGetValueFromString($val)
  83. {
  84. $cookie = Zend_Http_Cookie::fromString('cookie=' . urlencode($val) . '; domain=example.com');
  85. $this->assertEquals($val, $cookie->getValue());
  86. }
  87. /**
  88. * Make sure we get the correct value if it was set through fromString()
  89. *
  90. * @param string $value
  91. * @dataProvider validCookieValueProvider
  92. */
  93. public function testGetRawValueFromString($val)
  94. {
  95. // Because ';' has special meaning in the cookie, strip it out for this test.
  96. $val = str_replace(';', '', $val);
  97. $cookie = Zend_Http_Cookie::fromString('cookie=' . $val . '; domain=example.com', null, false);
  98. $this->assertEquals($val, $cookie->getValue());
  99. }
  100. /**
  101. * Make sure we get the correct value if it was set through fromString()
  102. *
  103. * @param string $value
  104. * @dataProvider validCookieValueProvider
  105. */
  106. public function testGetRawValueFromStringToString($val)
  107. {
  108. // Because ';' has special meaning in the cookie, strip it out for this test.
  109. $val = str_replace(';', '', $val);
  110. $cookie = Zend_Http_Cookie::fromString('cookie=' . $val . '; domain=example.com', null, false);
  111. $this->assertEquals('cookie=' . $val . ';', (string)$cookie);
  112. }
  113. /**
  114. * Make sure we get the correct value if it was set through fromString()
  115. *
  116. * @param string $value
  117. * @dataProvider validCookieValueProvider
  118. */
  119. public function testGetValueFromStringEncodedToString($val)
  120. {
  121. // Because ';' has special meaning in the cookie, strip it out for this test.
  122. $val = str_replace(';', '', $val);
  123. $cookie = Zend_Http_Cookie::fromString('cookie=' . $val . '; domain=example.com', null, true);
  124. $this->assertEquals('cookie=' . urlencode($val) . ';', (string)$cookie);
  125. }
  126. /**
  127. * Make sure we get the correct domain when it's set in the cookie string
  128. *
  129. * @dataProvider validCookieWithInfoProvider
  130. */
  131. public function testGetDomainInStr($cStr, $cInfo)
  132. {
  133. $cookie = Zend_Http_Cookie::fromString($cStr);
  134. if (! $cookie instanceof Zend_Http_Cookie) {
  135. $this->fail("Failed creating a cookie object from '$cStr'");
  136. }
  137. if (isset($cInfo['domain'])) {
  138. $this->assertEquals($cInfo['domain'], $cookie->getDomain());
  139. }
  140. }
  141. /**
  142. * Make sure we get the correct domain when it's set in a reference URL
  143. *
  144. * @dataProvider refUrlProvider
  145. */
  146. public function testGetDomainInRefUrl(Zend_Uri $uri)
  147. {
  148. $domain = $uri->getHost();
  149. $cookie = Zend_Http_Cookie::fromString('foo=baz; path=/', 'http://' . $domain);
  150. if (! $cookie instanceof Zend_Http_Cookie) {
  151. $this->fail("Failed creating a cookie object with URL '$uri'");
  152. }
  153. $this->assertEquals($domain, $cookie->getDomain());
  154. }
  155. /**
  156. * Make sure we get the correct path when it's set in the cookie string
  157. *
  158. * @dataProvider validCookieWithInfoProvider
  159. */
  160. public function testGetPathInStr($cStr, $cInfo)
  161. {
  162. $cookie = Zend_Http_Cookie::fromString($cStr);
  163. if (! $cookie instanceof Zend_Http_Cookie) {
  164. $this->fail("Failed creating a cookie object from '$cStr'");
  165. }
  166. if (isset($cInfo['path'])) {
  167. $this->assertEquals($cInfo['path'], $cookie->getPath());
  168. }
  169. }
  170. /**
  171. * Make sure we get the correct path when it's set a reference URL
  172. *
  173. * @dataProvider refUrlProvider
  174. */
  175. public function testGetPathInRefUrl(Zend_Uri $uri)
  176. {
  177. $path = $uri->getPath();
  178. if (substr($path, -1, 1) == '/') $path .= 'x';
  179. $path = dirname($path);
  180. if ($path == DIRECTORY_SEPARATOR) {
  181. $path = '/';
  182. }
  183. $cookie = Zend_Http_Cookie::fromString('foo=bar', (string) $uri);
  184. if (! $cookie instanceof Zend_Http_Cookie) {
  185. $this->fail("Failed creating a cookie object with URL '$uri'");
  186. }
  187. $this->assertEquals($path, $cookie->getPath());
  188. }
  189. /**
  190. * Test we get the correct expiry time
  191. *
  192. * @dataProvider validCookieWithInfoProvider
  193. */
  194. public function testGetExpiryTime($cStr, $cInfo)
  195. {
  196. $cookie = Zend_Http_Cookie::fromString($cStr);
  197. if (! $cookie instanceof Zend_Http_Cookie) {
  198. $this->fail("Failed creating a cookie object from '$cStr'");
  199. }
  200. if (isset($cInfo['expires'])) {
  201. $this->assertEquals($cInfo['expires'], $cookie->getExpiryTime());
  202. }
  203. }
  204. /**
  205. * Make sure the "is secure" flag is correctly set
  206. *
  207. * @dataProvider validCookieWithInfoProvider
  208. */
  209. public function testIsSecure($cStr, $cInfo)
  210. {
  211. $cookie = Zend_Http_Cookie::fromString($cStr);
  212. if (! $cookie instanceof Zend_Http_Cookie) {
  213. $this->fail("Failed creating a cookie object from '$cStr'");
  214. }
  215. if (isset($cInfo['secure'])) {
  216. $this->assertEquals($cInfo['secure'], $cookie->isSecure());
  217. }
  218. }
  219. /**
  220. * Cookie expiry time tests
  221. */
  222. /**
  223. * Make sure we get the correct value for 'isExpired'
  224. *
  225. * @dataProvider cookieWithExpiredFlagProvider
  226. */
  227. public function testIsExpired($cStr, $expired)
  228. {
  229. $cookie = Zend_Http_Cookie::fromString($cStr);
  230. if (! $cookie) {
  231. $this->fail("Failed creating a cookie object from '$cStr'");
  232. }
  233. $this->assertEquals($expired, $cookie->isExpired());
  234. }
  235. /**
  236. * Make sure we get the correct value for 'isExpired', when time is manually set
  237. */
  238. public function testIsExpiredDifferentTime()
  239. {
  240. $notexpired = time() + 3600;
  241. $expired = time() - 3600;
  242. $now = time() + 7200;
  243. $cookies = array(
  244. 'cookie=foo; domain=example.com; expires=' . date(DATE_COOKIE, $notexpired),
  245. 'cookie=foo; domain=example.com; expires=' . date(DATE_COOKIE, $expired)
  246. );
  247. // Make sure all cookies are expired
  248. foreach ($cookies as $cstr) {
  249. $cookie = Zend_Http_Cookie::fromString($cstr);
  250. if (! $cookie) $this->fail('Got no cookie object from a valid cookie string');
  251. $this->assertTrue($cookie->isExpired($now), 'Cookie is expected to be expired');
  252. }
  253. // Make sure all cookies are not expired
  254. $now = time() - 7200;
  255. foreach ($cookies as $cstr) {
  256. $cookie = Zend_Http_Cookie::fromString($cstr);
  257. if (! $cookie) $this->fail('Got no cookie object from a valid cookie string');
  258. $this->assertFalse($cookie->isExpired($now), 'Cookie is expected not to be expired');
  259. }
  260. }
  261. /**
  262. * Test we can properly check if a cookie is a session cookie (has no expiry time)
  263. *
  264. * @dataProvider validCookieWithInfoProvider
  265. */
  266. public function testIsSessionCookie($cStr, $cInfo)
  267. {
  268. $cookie = Zend_Http_Cookie::fromString($cStr);
  269. if (! $cookie instanceof Zend_Http_Cookie) {
  270. $this->fail("Failed creating a cookie object from '$cStr'");
  271. }
  272. if (array_key_exists('expires', $cInfo)) {
  273. $this->assertEquals(($cInfo['expires'] === null), $cookie->isSessionCookie());
  274. }
  275. }
  276. /**
  277. * Make sure cookies are properly converted back to strings
  278. *
  279. * @dataProvider validCookieWithInfoProvider
  280. */
  281. public function testToString($cStr, $cInfo)
  282. {
  283. $cookie = Zend_Http_Cookie::fromString($cStr);
  284. if (! $cookie instanceof Zend_Http_Cookie) {
  285. $this->fail("Failed creating a cookie object from '$cStr'");
  286. }
  287. $expected = substr($cStr, 0, strpos($cStr, ';') + 1);
  288. $this->assertEquals($expected, (string) $cookie);
  289. }
  290. public function testGarbageInStrIsIgnored()
  291. {
  292. $cookies = array(
  293. 'name=value; domain=foo.com; silly=place; secure',
  294. 'foo=value; someCrap; secure; domain=foo.com; ',
  295. 'anothercookie=value; secure; has some crap; ignore=me; domain=foo.com; '
  296. );
  297. foreach ($cookies as $cstr) {
  298. $cookie = Zend_Http_Cookie::fromString($cstr);
  299. if (! $cookie) $this->fail('Got no cookie object from a valid cookie string');
  300. $this->assertEquals('value', $cookie->getValue(), 'Value is not as expected');
  301. $this->assertEquals('foo.com', $cookie->getDomain(), 'Domain is not as expected');
  302. $this->assertTrue($cookie->isSecure(), 'Cookie is expected to be secure');
  303. }
  304. }
  305. /**
  306. * Test the match() method against a domain
  307. *
  308. * @dataProvider domainMatchTestProvider
  309. */
  310. public function testMatchDomain($cookieStr, $uri, $match)
  311. {
  312. $cookie = Zend_Http_Cookie::fromString($cookieStr);
  313. $this->assertEquals($match, $cookie->match($uri));
  314. }
  315. static public function domainMatchTestProvider()
  316. {
  317. $uri = Zend_Uri::factory('http://www.foo.com/some/file.txt');
  318. return array(
  319. array('foo=bar; domain=.example.com;', 'http://www.example.com/foo/bar.php', true),
  320. array('foo=bar; domain=.example.com;', 'http://example.com/foo/bar.php', true),
  321. array('foo=bar; domain=.example.com;', 'http://www.somexample.com/foo/bar.php', false),
  322. array('foo=bar; domain=example.com;', 'http://www.somexample.com/foo/bar.php', false),
  323. array('cookie=value; domain=www.foo.com', $uri, true),
  324. array('cookie=value; domain=www.foo.com', 'http://il.www.foo.com', true),
  325. array('cookie=value; domain=www.foo.com', 'http://bar.foo.com', false)
  326. );
  327. }
  328. /**
  329. * Test the match() method against a domain
  330. *
  331. */
  332. public function testMatchPath()
  333. {
  334. $cookie = Zend_Http_Cookie::fromString('foo=bar; domain=.example.com; path=/foo');
  335. $this->assertTrue($cookie->match('http://www.example.com/foo/bar.php'), 'Cookie expected to match, but didn\'t');
  336. $this->assertFalse($cookie->match('http://www.example.com/bar.php'), 'Cookie expected not to match, but did');
  337. $cookie = Zend_Http_Cookie::fromString('cookie=value; domain=www.foo.com; path=/some/long/path');
  338. $this->assertTrue($cookie->match('http://www.foo.com/some/long/path/file.txt'), 'Cookie expected to match, but didn\'t');
  339. $this->assertTrue($cookie->match('http://www.foo.com/some/long/path/and/even/more'), 'Cookie expected to match, but didn\'t');
  340. $this->assertFalse($cookie->match('http://www.foo.com/some/long/file.txt'), 'Cookie expected not to match, but did');
  341. $this->assertFalse($cookie->match('http://www.foo.com/some/different/path/file.txt'), 'Cookie expected not to match, but did');
  342. }
  343. /**
  344. * Test the match() method against secure / non secure connections
  345. *
  346. */
  347. public function testMatchSecure()
  348. {
  349. // A non secure cookie, should match both
  350. $cookie = Zend_Http_Cookie::fromString('foo=bar; domain=.example.com;');
  351. $this->assertTrue($cookie->match('http://www.example.com/foo/bar.php'), 'Cookie expected to match, but didn\'t');
  352. $this->assertTrue($cookie->match('https://www.example.com/bar.php'), 'Cookie expected to match, but didn\'t');
  353. // A secure cookie, should match secure connections only
  354. $cookie = Zend_Http_Cookie::fromString('foo=bar; domain=.example.com; secure');
  355. $this->assertFalse($cookie->match('http://www.example.com/foo/bar.php'), 'Cookie expected not to match, but it did');
  356. $this->assertTrue($cookie->match('https://www.example.com/bar.php'), 'Cookie expected to match, but didn\'t');
  357. }
  358. /**
  359. * Test the match() method against different expiry times
  360. *
  361. */
  362. public function testMatchExpire()
  363. {
  364. // A session cookie - should always be valid
  365. $cookie = Zend_Http_Cookie::fromString('foo=bar; domain=.example.com;');
  366. $this->assertTrue($cookie->match('http://www.example.com/'), 'Cookie expected to match, but didn\'t');
  367. $this->assertTrue($cookie->match('http://www.example.com/', true, time() + 3600), 'Cookie expected to match, but didn\'t');
  368. // A session cookie, should not match
  369. $this->assertFalse($cookie->match('https://www.example.com/', false), 'Cookie expected not to match, but it did');
  370. $this->assertFalse($cookie->match('https://www.example.com/', false, time() - 3600), 'Cookie expected not to match, but it did');
  371. // A cookie with expiry time in the future
  372. $cookie = Zend_Http_Cookie::fromString('foo=bar; domain=.example.com; expires=' . date(DATE_COOKIE, time() + 3600));
  373. $this->assertTrue($cookie->match('http://www.example.com/'), 'Cookie expected to match, but didn\'t');
  374. $this->assertFalse($cookie->match('https://www.example.com/', true, time() + 7200), 'Cookie expected not to match, but it did');
  375. // A cookie with expiry time in the past
  376. $cookie = Zend_Http_Cookie::fromString('foo=bar; domain=.example.com; expires=' . date(DATE_COOKIE, time() - 3600));
  377. $this->assertFalse($cookie->match('http://www.example.com/'), 'Cookie expected not to match, but it did');
  378. $this->assertTrue($cookie->match('https://www.example.com/', true, time() - 7200), 'Cookie expected to match, but didn\'t');
  379. }
  380. public function testFromStringFalse()
  381. {
  382. $cookie = Zend_Http_Cookie::fromString('foo; domain=www.exmaple.com');
  383. $this->assertEquals(false, $cookie, 'fromString was expected to fail and return false');
  384. $cookie = Zend_Http_Cookie::fromString('=bar; secure; domain=foo.nl');
  385. $this->assertEquals(false, $cookie, 'fromString was expected to fail and return false');
  386. $cookie = Zend_Http_Cookie::fromString('fo;o=bar; secure; domain=foo.nl');
  387. $this->assertEquals(false, $cookie, 'fromString was expected to fail and return false');
  388. }
  389. /**
  390. * Test that cookies with far future expiry date (beyond the 32 bit unsigned int range) are
  391. * not mistakenly marked as 'expired'
  392. *
  393. * @link http://framework.zend.com/issues/browse/ZF-5690
  394. */
  395. public function testZF5690OverflowingExpiryDate()
  396. {
  397. $expTime = "Sat, 29-Jan-2039 00:54:42 GMT";
  398. $cookie = Zend_Http_Cookie::fromString("foo=bar; domain=.example.com; expires=$expTime");
  399. $this->assertFalse($cookie->isExpired(), 'Expiry: ' . $cookie->getExpiryTime());
  400. }
  401. /**
  402. * Data Providers
  403. */
  404. /**
  405. * Provide characters which are invalid in cookie names
  406. *
  407. * @return array
  408. */
  409. static public function invalidCookieNameCharProvider()
  410. {
  411. return array(
  412. array("="),
  413. array(","),
  414. array(";"),
  415. array("\t"),
  416. array("\r"),
  417. array("\n"),
  418. array("\013"),
  419. array("\014")
  420. );
  421. }
  422. /**
  423. * Provide valid cookie values
  424. *
  425. * @return array
  426. */
  427. static public function validCookieValueProvider()
  428. {
  429. return array(
  430. array('simpleCookie'),
  431. array('space cookie'),
  432. array('!@#$%^*&()* ][{}?;'),
  433. array("line\n\rbreaks"),
  434. array("0000j8CydACPu_-J9bE8uTX91YU:12a83ks4k"), // value from: Alexander Cheshchevik's comment on issue: ZF-1850
  435. // Long cookie value - 2kb
  436. array(str_repeat(md5(time()), 64))
  437. );
  438. }
  439. /**
  440. * Provider of valid reference URLs to be used for creating cookies
  441. *
  442. * @return array
  443. */
  444. static public function refUrlProvider()
  445. {
  446. return array(
  447. array(Zend_Uri::factory('http://example.com/')),
  448. array(Zend_Uri::factory('http://www.example.com/foo/bar/')),
  449. array(Zend_Uri::factory('http://some.really.deep.domain.com')),
  450. array(Zend_Uri::factory('http://localhost/path/to/very/deep/file.php')),
  451. array(Zend_Uri::factory('http://arr.gr/some%20path/text%2Ffile'))
  452. );
  453. }
  454. /**
  455. * Provide valid cookie strings with information about them
  456. *
  457. * @return array
  458. */
  459. static public function validCookieWithInfoProvider()
  460. {
  461. $now = time();
  462. $yesterday = $now - (3600 * 24);
  463. return array(
  464. array(
  465. 'justacookie=foo; domain=example.com',
  466. array(
  467. 'name' => 'justacookie',
  468. 'domain' => 'example.com',
  469. 'path' => '/',
  470. 'expires' => null,
  471. 'secure' => false
  472. )
  473. ),
  474. array(
  475. 'expires=tomorrow; secure; path=/Space Out/; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=.example.com',
  476. array(
  477. 'name' => 'expires',
  478. 'domain' => '.example.com',
  479. 'path' => '/Space Out/',
  480. 'expires' => strtotime('Tue, 21-Nov-2006 08:33:44 GMT'),
  481. 'secure' => true
  482. )
  483. ),
  484. array(
  485. 'domain=unittests; expires=' . date(DATE_COOKIE, $now) . '; domain=example.com; path=/some%20value/',
  486. array(
  487. 'name' => 'domain',
  488. 'domain' => 'example.com',
  489. 'path' => '/some%20value/',
  490. 'expires' => $now,
  491. 'secure' => false,
  492. )
  493. ),
  494. array(
  495. 'path=indexAction; path=/; domain=.foo.com; expires=' . date(DATE_COOKIE, $yesterday),
  496. array(
  497. 'name' => 'path',
  498. 'domain' => '.foo.com',
  499. 'path' => '/',
  500. 'expires' => $yesterday,
  501. 'secure' => false
  502. )
  503. ),
  504. array(
  505. 'secure=sha1; secure; SECURE; domain=some.really.deep.domain.com',
  506. array(
  507. 'name' => 'secure',
  508. 'domain' => 'some.really.deep.domain.com',
  509. 'path' => '/',
  510. 'expires' => null,
  511. 'secure' => true
  512. )
  513. ),
  514. array(
  515. 'PHPSESSID=123456789+abcd%2Cef; secure; domain=.localdomain; path=/foo/baz; expires=Tue, 21-Nov-2006 08:33:44 GMT;',
  516. array(
  517. 'name' => 'PHPSESSID',
  518. 'domain' => '.localdomain',
  519. 'path' => '/foo/baz',
  520. 'expires' => strtotime('Tue, 21-Nov-2006 08:33:44 GMT'),
  521. 'secure' => true
  522. )
  523. ),
  524. );
  525. }
  526. /**
  527. * Cookie with 'expired' flag, used to test if Cookie->isExpired()
  528. *
  529. * @return array
  530. */
  531. public static function cookieWithExpiredFlagProvider()
  532. {
  533. return array(
  534. array('cookie=foo;domain=example.com;expires=' . date(DATE_COOKIE, time() + 12 * 3600), false),
  535. array('cookie=foo;domain=example.com;expires=' . date(DATE_COOKIE, time() - 15), true),
  536. array('cookie=foo;domain=example.com;', false),
  537. array('cookie=foo;domain=example.com;expires=Fri, 01-Mar-2109 00:19:21 GMT', false),
  538. array('cookie=foo;domain=example.com;expires=Fri, 06-Jun-1966 00:19:21 GMT', true),
  539. );
  540. }
  541. }