Skip to main content
Question

How to prevent API Scan from Autosaving API cookies and send it in next request?

  • September 19, 2025
  • 3 replies
  • 72 views

Hi All,

How to prevent API Scan from saving API cookies and send it in next request. Basically I don’t want to Autosave API cookies saved in first API test step or delete it for next request  Test Step in Test case. Tried the setting TCP like AutoSetCookies to False.

 

It would be great help if anyone knows solution? Using 2024.1 version.

 

3 replies

  • Author
  • Space Cadet
  • September 25, 2025

Hi All,

Any suggestions on this?

 


To prevent Tosca API Scan from automatically saving and sending cookies in subsequent requests, you're on the right track with the AutoSetCookies Test Configuration Parameter (TCP). However, there are a couple of additional details and settings you should be aware of to ensure it works as intended:

Steps to Disable Automatic Cookie Handling in Tosca API Tests

1. Set AutoSetCookies to False

This disables Tosca’s automatic cookie management. When set to False, Tosca will not store cookies from one request and reuse them in the next.

  • Where to set it:

    • In the TestCase → Right-click → Properties → Add TCP → AutoSetCookies = False

    • Or in ScratchBook for trial runs

2. Ensure FlushCookies is Not Interfering

By default, Tosca deletes cookies after each execution. If you’ve set FlushCookies = False, Tosca may retain cookies across steps. To avoid this:

  • Either don’t set FlushCookies at all

  • Or explicitly set FlushCookies = True to ensure cookies are cleared after each step

3. Avoid Using Shared Sessions

If your API TestSteps are using shared sessions or environments, cookies might persist unintentionally. Make sure each TestStep is isolated or uses a fresh session.

Reference

You can find more details in Tricentis’s official documentation on cookie management in Tosca API Engine.

If you've already tried these steps and cookies are still being reused, it might be worth checking if:

  • The API server is setting cookies in a way that Tosca can't ignore

  • There's a bug in Tosca 2024.1 affecting cookie isolation

Would you like help drafting a support ticket to Tricentis or testing a sample configuration to verify cookie behavior?


Ramanan
Forum|alt.badge.img+6
  • Ace Pilot
  • October 2, 2025

Hi All,

How to prevent API Scan from saving API cookies and send it in next request. Basically I don’t want to Autosave API cookies saved in first API test step or delete it for next request  Test Step in Test case. Tried the setting TCP like AutoSetCookies to False.

 

It would be great help if anyone knows solution? Using 2024.1 version.

 

@ShraddhaY ,

You can disable cookie persistence by turning off AutoSetCookies at the test case level or by adding a step to clear cookies before the next request. In 2024.1, you may also need to check the project settings to ensure cookies aren’t carried over automatically.