title: Creating cookie using node.js
body: <p>how do I create cookie in node.js in the root route (i.e. localhost:3000/ ) I am able to create cookie in other routes (such as localhost:3000/createcookie) but how to do it when user opens localhost:3000.</p>
  <p>I have tried to create it in the root route just by pasting 'res.cookie('user', 'user1');' in the root route funtion. It is working when it is in other routes but not working in the root route.</p>