Skip to content

Commit 418c793

Browse files
marcohankestaabm
andauthored
fix cookie handling (#31)
Co-authored-by: Markus Staab <maggus.staab@googlemail.com> Co-authored-by: staabm <staabm@users.noreply.github.com>
1 parent f9a8eaa commit 418c793

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Url.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ public function getContent(): rex_socket_response
115115
$cookie = $response->getHeader('Set-Cookie');
116116

117117
if (null !== $cookie) {
118-
$socket->addHeader('Cookie', substr($cookie, 0, strpos($cookie, ';')));
118+
// separate cookie value from optional attributes
119+
[$cookieValue] = explode(';', $cookie);
120+
$socket->addHeader('Cookie', $cookieValue);
119121
$response = $socket->doGet();
120122
}
121123

0 commit comments

Comments
 (0)