Cookies & Context
-
I’ve uncommented this line:
define('FETCH_COOKIES_ENABLED', true);
Trying to get cookie data to my pdf template throws the following error:
PHP Warning: file_get_contents(https://my-host.local/my-page/?pdf-template): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
I’ve checked to make sure that allow_url_fopen is true. The context that is created appears to be valid: it traces out as a resource with an ID.
This happens with both /pdf/ and /pdf-preview/ on the end of the URL. I’ve manually filtered the cookies such that only the items I want are passed. At that time, things work fine. Modifying the plugin, however, will cause it to break if it is updated. And it’s nearly impossible to keep ones client from updating plugins, thanks to WPs nag mode.
Is it possible, therefore to:
1. change the FETCH_COOKIES_ENABLED by a setting instead of modifying code
2. insert a filter that would allow me to specify which cookies get passed
- The topic ‘Cookies & Context’ is closed to new replies.