When testing with 4D web server and setting HTTP cookies, there are a couple ways to see the cookies that are sent to the web browser. By defualt, 4D automatically handles and sends its own cookies. However, you can manage and send your own cookies as well.
Using WEB GET HTTP HEADER:
If you manually manage web requests or send your own cookies, you can check the sent cookies by calling HTTP GET HEADER in the 'On Web Connection Method'.
For example, you set your own cookie named 'USER' and give it a value 'MyTestCookie' in the 'On Web Connection' Method:
You can check the HTTP cookies by placing the command below in the 'On Web Connection' method and making a web request:
And check the header value array to see your sent cookie along with others:
Using Web Inspector:
You can also use the web inspector tool to see the used cookies. This tool provides the information in a more easy to read format. The steps below may vary slightly depening on your web browser. For Google Chrome:
- To open the web inspector, right-click on the web page and select 'Inspect'
- On the top of the inspector, click 'Application'. Then on the left side, click 'cookies'. Then click on the web page's domain name
- The inspector should display something like the image below which shows all of the used cookies and their attributes. In the list, we see the 'USER' cookies we sent as well as its attributes