search

Home  >  Q&A  >  body text

Cookie - What should I do when the apache ab stress testing tool requires user login to measure?

-Explanation of C parameters:

-C cookie-name=value Attach a Cookie: line to the request. Its typical form is a parameter pair of name=value. This parameter can be repeated.

Who can give an example?

黄舟黄舟2749 days ago523

reply all(1)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-16 17:06:57

    First build a "logged in" session and write down the cookie value (Session ID) that identifies this session.
    If only one cookie is used:
    ab -n 100 -C Key1=Value1
    If you need multiple cookies, just set the Header directly:
    ab -n 100 -H “Cookie: Key1=Value1; Key2=Value2”

    reply
    0
  • Cancelreply