How do i invalidate my previous session in my app during a load test?

When I execute for 1 min after 40 sec its getting failed. So how do i can cancel or delete previous session

errror: “You are already logged in from another client. You can either wait for the other login to end or contact your local support personnel to cancel the existing login”.

export default function () {

  //get token
  let resToken ='url', clientcred, {headers: theader});

  let resTokenBody = resToken.body;
  let resTokenObj = JSON.parse(resTokenBody);
  let oAuthToken = resTokenObj.access_token;
  let auth = "bearer " + oAuthToken;
  params.headers.Authorization = auth;

  let res =,JSON.stringify(data),params);
  console.log( JSON.stringify(res.body));
  check(res, {
    'is status 200': (r) => r.status === 200,


Web servers can be configured to only allow a single session per user. One of the ways this is achieved is via cookies, another is via some username/password credentials, and another would be by IP address but that approach is less common.

By default, each VU maintains its own set of cookies, and the cookies are cleared between each iteration/execution of your script’s default function. This means that for each of the POST requests, the cookies per VU should be unique, so we can probably rule out cookies being a reason.

Does the problem only happen when you run multiple VUs? I note you are passing in clientcreds. If all of your VUs are using the same clientcreds, the server may be configured to only allow one use of these at a time.

The wording of the error message suggests there may be a way to explicitly log out, and that not doing so might leave the session lingering on the server-side for some period of time before it deems the session is over. Perhaps a logout needs incorporating into the script.

If you’re able to share the URL and credentials (DM me if you want to keep it private), then I’d be able to diagnose further.