Skip to content

Commit 1024754

Browse files
authored
Added setCookie. (#6197)
1 parent 8ab9496 commit 1024754

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Server/Response.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ public function withCookie(Cookie $cookie): static
4747
return $clone;
4848
}
4949

50+
/**
51+
* Returns an instance with specified cookies.
52+
*/
53+
public function setCookie(Cookie $cookie): static
54+
{
55+
$this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie;
56+
return $this;
57+
}
58+
5059
/**
5160
* Retrieves all cookies.
5261
*/

0 commit comments

Comments
 (0)