I'm working on a project which runs a PHP document on localhost. The PHP accepts and saves-as-cookie some user input.
Then it's supposed to execute a javascript script which uses the data in the cookie to perform a calculation, and return the calculation to the PHP document.
The first part is fine. The application prompts user for input and saves it to a cookie as expected. I check chrome://settings/cookies and see the cookie in locally stored data, Domain: localhost. fine.
In the same directory, I have a file called calculate.js. I know calculate.js is working, and being executed correctly from the PHP, with dummy data. But: How can I save the value of the cookie to a var in calculate.js?