@@ -465,14 +465,16 @@ protected function getCookieId($cookie)
465465 *
466466 * @param array|ArrayIterator|SetCookie|string $cookie
467467 * @param string $value
468+ * @param string $version
469+ * @param string $maxAge
468470 * @param string $domain
469471 * @param string $expire
470472 * @param string $path
471473 * @param boolean $secure
472474 * @param boolean $httponly
473475 * @return Client
474476 */
475- public function addCookie ($ cookie , $ value = null , $ domain = null , $ expire = null , $ path = null , $ secure = false , $ httponly = true )
477+ public function addCookie ($ cookie , $ value = null , $ version = null , $ maxAge = null , $ domain = null , $ expire = null , $ path = null , $ secure = false , $ httponly = true )
476478 {
477479 if (is_array ($ cookie ) || $ cookie instanceof ArrayIterator) {
478480 foreach ($ cookie as $ setCookie ) {
@@ -485,7 +487,7 @@ public function addCookie($cookie, $value = null, $domain = null, $expire = null
485487 } elseif ($ cookie instanceof SetCookie) {
486488 $ this ->cookies [$ this ->getCookieId ($ cookie )] = $ cookie ;
487489 } elseif (is_string ($ cookie ) && $ value !== null ) {
488- $ setCookie = new SetCookie ($ cookie , $ value , null , null , $ domain , $ expire , $ path , $ secure , $ httponly );
490+ $ setCookie = new SetCookie ($ cookie , $ value , $ version , $ maxAge , $ domain , $ expire , $ path , $ secure , $ httponly );
489491 $ this ->cookies [$ this ->getCookieId ($ setCookie )] = $ setCookie ;
490492 } else {
491493 throw new Exception \InvalidArgumentException ('Invalid parameter type passed as Cookie ' );
0 commit comments