Reputation: 330
I would like to have a simple performance test which logs in multiple users, the sessions are created and do not expire until n minutes (where n is a parameter). Is it possible to do this with JMeter? Do JMeter invalidate sessions at the end of the test?
Upvotes: 1
Views: 1581
Reputation: 641
In general, the expiration times of your cookies have to be set on the server side. The actual implementation will vary depending on your server side technology stack (see e.g. here for PHP's session docs), but it should be feasible, for example, to make a simple page that recognizes an "incoming" GET parameter value (from jMeter) for setting the cookie's expiration time when issuing the cookie.
On the client side (jMeter) the straight forward way for managing sessions is by using the CookieManager component. Each thread will have its own session cookie until the end of the test (or until the end of the iteration, if you configure the CookieManager accordingly).
If your test targets a typical web application that uses login forms for user logins, you could login each user (i.e. thread) e.g. by reading credentials from a username/password list in the form of a csv file (see CSV Data Set Config) and posting these credentials to the login form's action URL.
Upvotes: 1
Reputation: 5682
see httpd.conf (in Apache) for information on setting the duration of the session before timeout. This timeout is offset from the last request from a given session.
Upvotes: 1