Managing sessions with cookies
A majority of web applications rely on cookies to maintain the session state. In the very early stages of the Internet, cookies were only used to keep the session ID. Things have since evolved and cookies now store a lot more information, such as user IDs and location preferences. The banking application we used as a case study in Chapter 2, Recording Your First Test, for example, relies on cookies to help each user maintain a valid session with the server, enabling the user to make a series of requests to the server. An example will help clear things up, so let's get right to one. For our example, some resources are protected based on the role of the user that is logged in. Users can have an admin or user role.
The steps to manage sessions with cookies are as follows:
Launch JMeter.
Start the HTTP proxy server (see Chapter 2, Recording Your First Test, if you don't know how).
In the browser, go to http://jmeterbook.aws.af.cm/.
Click on the User Protected Resource...