I'm trying to do load testing using JMeter 2.5.1. The application is written in PHP, and uses the standard cookie-based session management with a named session. Currently, the test plan is a very simple 2 HTTP request and 1 Cookie Manager within 1 Thread Group. The Cookie Manager's cookie policy is set to compatibility as suggested by the tutorials. However, the session still gets lost on each request.
On the first page call, the session is initialized. I printed the following info before and after the session_start call:
before session start:
session_name() = 'PHPSESSID'
session_id() = ''
$_COOKIE = array (
)
after session start:
session_name() = 'sasExtSMSESSID'
session_id() = 'ihl8svsbl76au7h1ccn3c0ci61'
$_COOKIE = array (
)
On the second page call, the session is supposed to have already been set. But it seems that the cookie that JMeter's cookie manager is corrupted:
before session start:
session_name() = 'PHPSESSID'
session_id() = ''
$_COOKIE = array (
'sasExtSMSESSID' => 'ihl8svsbl76au7h1ccn3c0ci61, sasExtSMSESSID=ihl8svsbl76au7h1ccn3c0ci61',
)
after session start:
session_name() = 'sasExtSMSESSID'
session_id() = '2ro2bkd3t3liq76h7lqn603gm7'
$_COOKIE = array (
'sasExtSMSESSID' => 'ihl8svsbl76au7h1ccn3c0ci61, sasExtSMSESSID=ihl8svsbl76au7h1ccn3c0ci61',
)
So it seems that the cookie array is corrupted somehow, and as the session id is invalid a new one is generated. Beyond calling session_name()
and session_start()
, there is nothing special in the application that deals with cookies. Accessing the pages using browsers also works. So I guess I didn't configure the JMeter correctly. Any idea what could have caused this? Any help is greatly appreciated.