What exactly is the usage of HTTP Cookie manager.
How do we determine, while writing a script that the website needs a HTTP Cookie Manager.
What exactly is the usage of HTTP Cookie manager
HTTP Cookie Manager, stores and send the cookies just as a browser do. If your HTTP Request response contains a cookie, the Cookie Manager automatically stores that cookie and will use it for all future requests to that particular web site. Use of cookies eventually becomes necessary when you application has to maintain session, like once your logs in to an application, it maintains the session of that user so that he/she can work inside the application. If that session is not maintained (via Cookie Manager in case of JMeter), then user will logged out of the application as soon as he/she sends next request which requires Authentication.
You can take it like this, if your application have a session or uses cookies, then your script will not work without adding cookies in cookie manager, as then your script will not be able to maintain the session and the users (Threads) will be kicked-off the application as soon as they enter into it.
Each JMeter thread has its own "cookie storage area". So, if you are testing a web site that uses a cookie for storing session information, each JMeter thread will have its own session.
How do we determine, while writing a script that the website needs a HTTP Cookie Manager.
You can also refer to the below mentioned links for more details
https://blazemeter.com/blog/using-http-cookie-manager-jmeter-not-cookie-jar
https://lincolnloop.com/blog/load-testing-jmeter-part-1-getting-started/