delete_test_cookie does not remove session cookie

I wanted to check if a browser accepts cookies, so I used set_test_cookie and test_cookie_worked methods to check the same. Then I deleted the test cookies using delete_test_cookie method if the browser passed the test. But to my surprise the session cookie still resides in the browser.

So what exactly the delete_test_cookie does? Does it delete session cookie? Or is it that session cookie and test cookie are different?

You didn’t post any code, so we can’t tell if you’re using these functions correctly.

But I will point out that the docs for Setting test cookies state that the effects of these calls aren’t seen until the next page request. Keep in mind that what you do on the server can’t affect the browser until a request is received.

Pay particular attention to the example in that section.