2

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.

ananda
  • 357
  • 1
  • 2
  • 13
  • You will get more information by enabling debug for your HTTP Cookie Manager: select Cookie Manager > click Help in jmeter's main menu > click Enable Debug. So you will find in jmeter.log debug info for Cookie Manager. – Aliaksandr Belik Jan 17 '12 at 17:01

1 Answers1

0

I'm not sure if this is really an answer, since I still have no idea what is happening, but I guess this is a solution that others may benefit from.

Changing the Cookie Manager's policy from compatibility to default lets me to sidestep this issue, since the corruption apparently happens to another part of the cookie variable:

session_name() = 'sasExtSMSESSID'
session_id() = 'gknq98q7fpecjciti3da9l6mj7'
$_COOKIE = array (
  '$Version' => '0',
  'sasExtSMSESSID' => 'gknq98q7fpecjciti3da9l6mj7',
  '$Path' => '/, sasExtSMSESSID=gknq98q7fpecjciti3da9l6mj7',
)

So far having that $Path corrupted has produced no adverse effect.

Would still appreciate anyone explaining to me exactly what is happening here.

ananda
  • 357
  • 1
  • 2
  • 13
  • Try to enable debug for your HTTP Cookie Manager: select Cookie Manager > click Help in jmeter's main menu > click Enable Debug. – Aliaksandr Belik Nov 30 '11 at 08:38
  • You will get more information by enabling debug for your HTTP Cookie Manager: select Cookie Manager > click Help in jmeter's main menu > click Enable Debug. So you will find in jmeter.log debug info for Cookie Manager. – Aliaksandr Belik Nov 30 '11 at 08:44