$client = new \GuzzleHttp\Client(['cookies' => true]);
$request = $client->get($url, array(), array(
'timeout' => 20,
'connect_timeout' => 1.5,
'allow_redirects' => true,
'decode_content' => true
));
$request = $client->get($url, array(), array(
'timeout' => 20,
'connect_timeout' => 1.5,
'cookies' => true,
'allow_redirects' => true,
'decode_content' => true
));
echo "<pre>";
print_r($request);
GuzzleHttp\Psr7\Response Object
(
[reasonPhrase:GuzzleHttp\Psr7\Response:private] => OK
[statusCode:GuzzleHttp\Psr7\Response:private] => 200
[headers:GuzzleHttp\Psr7\Response:private] => Array
(
[Date] => Array
(
[0] => Tue, 21 Nov 2017 08:56:02 GMT
)
[Server] => Array
(
[0] => Apache
)
[X-Powered-By] => Array
(
[0] => PHP/7.1.1
)
[Cache-Control] => Array
(
[0] => no-cache, private
)
[Set-Cookie] => Array
(
[0] => XSRF-TOKEN=eyJpdiI6IlVmZjZ4Zjh4K0M0ZWJaZUQxcGtKbkE9PSIsInZhbHVlIjoidGEyaVBpaW1cL1Fxc25BQXQ2NWdDZ3pYU1JzXC92RVwvNGlcL1owQzhpTzNNSnpCMUVVMXlOT2VGZnBLendDeEptUXZHZktmR0NyYVFUSkJDRzRaTzlBVVhnPT0iLCJtYWMiOiI1MmJiMTNkMGIwMTQ0MjcyNjMwZWQzYzdjMGEzMDNhMGMyMDYxNzMzYWUwNTU5M2RhNWM0NGRkNzQ3NGM3MDMxIn0%3D; expires=Tue, 05-Dec-2017 08:56:02 GMT; Max-Age=1209600; path=/
[1] => platform_session=eyJpdiI6IkVJZFNCVW5jSmdDRUhGSmpjNUlyU1E9PSIsInZhbHVlIjoiWEkrNDZyS2QrckE2bSttWkhPSkxvWE93YTJcLzF3YlIzYlBVcGhZWGh6Y0I4VEQxaVV1NFZhODdaeUZuSFJmc2JZQkFzWVwvUGFUOEg3YWI5ajVRM3VJUT09IiwibWFjIjoiNzk4OWFkYjgxMzE3MjU4Yjg1MjEzMzBkOTg1ZjMwMTJkMzU4YTU2NjAyMzFiNWE1YmEyOGM5OWZjMjNkNGJjZSJ9; expires=Tue, 05-Dec-2017 08:56:02 GMT; Max-Age=1209600; path=/; HttpOnly
)
[Transfer-Encoding] => Array
(
[0] => chunked
)
[Content-Type] => Array
(
[0] => text/html; charset=UTF-8
)
)
[headerNames:GuzzleHttp\Psr7\Response:private] => Array
(
[date] => Date
[server] => Server
[x-powered-by] => X-Powered-By
[cache-control] => Cache-Control
[set-cookie] => Set-Cookie
[transfer-encoding] => Transfer-Encoding
[content-type] => Content-Type
)
[protocol:GuzzleHttp\Psr7\Response:private] => 1.1
[stream:GuzzleHttp\Psr7\Response:private] => GuzzleHttp\Psr7\Stream Object
(
[stream:GuzzleHttp\Psr7\Stream:private] => Resource id #1216
[size:GuzzleHttp\Psr7\Stream:private] =>
[seekable:GuzzleHttp\Psr7\Stream:private] => 1
[readable:GuzzleHttp\Psr7\Stream:private] => 1
[writable:GuzzleHttp\Psr7\Stream:private] => 1
[uri:GuzzleHttp\Psr7\Stream:private] => php://temp
[customMetadata:GuzzleHttp\Psr7\Stream:private] => Array
(
)
)
)
Если хранить не в БД, а в файловой системе - с разграничением доступа к отдельным файлам, мне кажется, возникает много проблем.