Skip to content

Commit 940978b

Browse files
author
Kent Richards
committed
Add initial cookie support in \PHPPM\Bridges\HttpKernel::mapRequest().
(cherry picked from commit 1c1a55d)
1 parent 349b65c commit 940978b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Bridges/HttpKernel.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,17 @@ protected static function mapRequest(ReactRequest $reactRequest, $content)
122122
parse_str($content, $post);
123123
}
124124

125+
$cookies = array();
126+
if (null !== ($headersCookie = $headers['Cookie'])) {
127+
foreach (explode(';', $headersCookie) as $cookie) {
128+
list($name, $value) = explode('=', trim($cookie));
129+
$cookies[$name] = $value;
130+
}
131+
}
132+
125133
$syRequest = new SymfonyRequest(
126134
// $query, $request, $attributes, $cookies, $files, $server, $content
127-
$query, $post, array(), array(), array(), array(), $content
135+
$query, $post, array(), $cookies, array(), array(), $content
128136
);
129137

130138
$syRequest->setMethod($method);

0 commit comments

Comments
 (0)