File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/Phaseolies/Http/Response Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,11 @@ public function getCacheControlDirective(string $key): bool|string|null
162162
163163 public function setCookie (Cookie $ cookie ): void
164164 {
165- $ this ->cookies [$ cookie ->getDomain ()][$ cookie ->getPath ()][$ cookie ->getName ()] = $ cookie ;
165+ $ domain = $ cookie ->getDomain () ?? '' ;
166+ $ path = $ cookie ->getPath () ?? '/ ' ;
167+ $ name = $ cookie ->getName ();
168+
169+ $ this ->cookies [$ domain ][$ path ][$ name ] = $ cookie ;
166170 $ this ->headerNames ['set-cookie ' ] = 'Set-Cookie ' ;
167171 }
168172
@@ -171,7 +175,8 @@ public function setCookie(Cookie $cookie): void
171175 */
172176 public function removeCookie (string $ name , ?string $ path = '/ ' , ?string $ domain = null ): void
173177 {
174- $ path ??= '/ ' ;
178+ $ domain = $ domain ?? '' ;
179+ $ path = $ path ?? '/ ' ;
175180
176181 unset($ this ->cookies [$ domain ][$ path ][$ name ]);
177182
You can’t perform that action at this time.
0 commit comments