Is there a known bug with cookies being cleared in web test? VS2008 Team System
-
Wednesday, February 20, 2008 3:05 AM
Is there a known bug with cookies not be cleared in a web test when the web site issues a command to clear a cookie (when it’s a session cookie)?
We have a test that part of it involves logging out which should clear the cookie (used for custom authentication).
When running this test in a load test we saw what appeared to be the cookie being sent back before the user has logged in, and the cookie gets appended to.
Eventually after 5 tests the server blows up because the header is too long; because of cookie that has continued to grow over each test.
I took the web test and modified it to repeat the same sequence of steps 5 times (doing the same thing the load test was doing, but manually...the load test at this point is a constant load of 1 with 5 tests to be run) to see if it was a load test issue or a web test issue.
I got the same results. In the modified web test at each login I could see the cookie the site uses (that's cleared on log out when doing manual testing of the same steps) growing exponentially. This cookie is a session cookie, not a persistent cookie.
Any help would be GREATLY appreciated.
Thanks!
All Replies
-
Monday, March 17, 2008 2:21 PMModerator
Hiya,
I tried to reproduce this over the weekend and didn't see this behavior.
How are you attempting to delete the session cookie? I believe the accepted practice is to set the cookie to expired which works ok for me. Are you doing something else?
--Mike
-
Monday, March 17, 2008 6:03 PM
I've been told that the web site calls Response.Cookies.Clear() but I cannot validate that and the site being tested is outside my control.
We were able to get around this by making the load test PercentageOfNewUsers property = 100%
-
Tuesday, March 18, 2008 3:39 PMModerator
Actually, I dug into this a little deeper and found that there is a bug here if session cookies are set to expired via the set-cookie directive. I've filed the bug.
Thanks for reporting it!
--Mike
-
Tuesday, March 18, 2008 9:47 PMCould I get the KB when it's ready...or I guess post the link?
Thanks for digging deep for me. -
Monday, March 31, 2008 3:06 PMModerator
Can you reply back to this and paste in the Set-Cookie header directives? (Both the one that sets the cookie and the one that tries to expire it but fails.) I'd like to double check and make sure it's the same issue.
You should be able to find them in the response tab of the webtest playback form.
Thanks!
--Mike
-
Thursday, January 21, 2010 2:17 AMIs there any update to this issue?I'm running into it now with VS2008 using IE8 to record a web test. I've even gone so far as to block all cookies in the browser, and the initial recording goes fine (because there's no cookie) but subsequent executions of the recording result in a failure due to the cookie allowing a redirect. Think of it as, "You've been here recently, so we're going to move you past all those initial pages."I've looked into converting the recording to a coded web test, and then explicitly clearing the cookie cache on each execution.Any advice?Upgrading to Vs2010 isn't an option at the moment. I tried to get my leadership to approve using the Beta2, but they passed and there will be no further discussion. Once it RTMs we'll convert, but not before, and I need to solve this problem now.Thanks in advance you geniuses.Hi Bill! ;-)
-
Wednesday, April 27, 2011 4:15 PM
I have the same issue. the solution for me is to 1) reduce the cookie's life time (see below 5 secounds) and 2) simulate(enlarge) thinktime for each WebTestRequests. this makes cookie's expiration rate greater than the cookie's adding rate.
String TicketEncrypted = FormsAuthentication.Encrypt(ticket);
RoleCookie.Expires = DateTime.Now.AddSeconds(5);

