All cookies related to the application are automatically sent to the server in the request header. Make sure that the cookie you want to send has the same application .
This can be verified by viewing your browserβs cookies. Make sure the cookie you want to send has the Domain as the name of your application. Like all stackoverflow cookies, the domain value will be .stackoverflow.com
You can refer to this guide, which talks about creating and setting a cookie in JavaScript: http://www.w3schools.com/js/js_cookies.asp
source share