| || |
Using cookies to avoid multiple sessions
I’m hoping someone will be kind enough to explain to me a correct method of attack to solve this problem I’m having with cookies / user sessions. I have spoken to Mercury, read everything I can get my hands on and am now more confused than ever.
This is my problem:
I am load testing an application with a secure log on. After I log on to the application, my session does not time until 60 minutes of non-activity has passed. My load test takes about 1.5 minutes to execute per iteration. It appears that each iteration is creating one new session. So in the end if I am running 5 vusers for 5 iterations by the end of the scenario I have 25 sessions open. What I need to be able to emulate (long story as to why) is 5 vusers for 5 iterations and only have 5 sessions open at the end of the iteration.
What I have figured out so far:
I am load testing an application that requires a secure log-on. When I go to the URL for the webpage, I can see that a persistent cookie is created and captured by LoadRunner. When I log-in to the webpage (SSL) no cookie is obvious to me but when I use web_save_header, I can see a different cookie is created. I believe this is a session cookie that is not automatically captured by WinRunner. I then used web_reg_save_param to capture the cookie. All this has been successful.
The confusing part (for me):
Now, my understanding of the theory is, if I use the cookie that I have captured using web_reg_save_param with web_add_cookie I should be able to have my vusers directly access the secure section of the webpage without logging in again and creating more an additional user sessions. Unfortunatley, I haven’t been able to make this work as all attempts leave me being redirected to the “Please logon screen” of the webpage.
Any help that someone would be kind enough to offer will be greatly appreciated. Thanks!
Re: Using cookies to avoid multiple sessions
Are you using the vuser_init section to login? I would recommend that. Make sure your runtime settings are set to "not simulate a new user on each iteration". Also, make sure you are not resetting context between iterations.