You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Troy Conner <co...@gmail.com> on 2021/08/11 23:09:06 UTC

problem with jmeter & session id's

i'm trying to connect from one site to another. The 2nd site assigns a
session id to the header, however it's responding with with "session
expired". I've added a reg exp extractor under the http request that looks
like this. The session id comes after 2000, but it doesn't work. How do i
get and supply my session id to all http requests in my script?

[image: image.png]

Re: problem with jmeter & session id's

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 13.08.21 um 10:24 schrieb Mariusz W:
> Hi,
> Troy, is this Test Plan created from recording proxy in JMeter? Maybe
> session Id is not enough to make another steps in application? Have
> You checked all constant values in request headers/bodies?

+1

Additionally: The link to the oracle apex docs states, that the session
id as parameter is one of a few places the session id can be given. A
cookie is mentioned, so adding a cookie manager should be the easiest
solution for managing the session. You will still have to get rid of
recorded static ids and managing other (probably) needed state variables.

I have found a few links regarding JMeter (recorded scripts) and Oracle
APEX:

*
https://community.oracle.com/tech/developers/discussion/4476826/apex-with-jmeter-again

* https://stackoverflow.com/questions/50251882/login-test-with-jmeter

The page
https://krisrice.io/2017-06-29-parameterizing-jmeter-for-testing-apex/ a
page is mentioned, that is used to get the initial session. That page is
used with a PostProcessor to get the corresponding state variables
p_instance, p_flow_id, ... Those values (JMeter variables) have then to
be used in the following requests everywhere, where static values were
recorded.

In your first picture, the variables would have to be placed in the
column value. For example the first row should look like

p_flow_id  |  ${p_flow_id}  | [ ] | text/plain | [/]

(If you extracted the flow id into the variable p_flow_id as done in the
blog entry (the extraction can probably be done by other extractors, too))

Felix

>
> Regards,
> Mariusz
>
>
> On Thu, 12 Aug 2021 at 15:36, Troy Conner <connert2017@gmail.com
> <ma...@gmail.com>> wrote:
>
>     Hello Felix,
>     Thanks for the response. These screenshots may be able to help you
>     to see my problem better. Can you let me know what I need to do to
>     resolve this?
>
>     pic 1 - This is the http request. Do I add the "sess" from the reg
>     exp ext to this list? if so, can you send me an example of how
>     that should look when done?
>     image.png
>
>     pic 2 - expired session I'm seeing in sample results tree. I'm
>     trying to fix this problem
>     image.png
>
>     pic 3 - session id in the Request>request body of the sample
>     results tree
>     image.png
>
>     pic 3 - The app I'm working with is Oracle apex. this is how it
>     handles session id's. This is the url to this doc
>     https://docs.oracle.com/database/121/HTMDB/concept_ses.htm#HTMDB03009
>     <https://docs.oracle.com/database/121/HTMDB/concept_ses.htm#HTMDB03009>
>     image.png
>
>
>     On Thu, Aug 12, 2021 at 12:10 AM Felix Schumacher
>     <felix.schumacher@internetallee.de
>     <ma...@internetallee.de>> wrote:
>
>
>         Am 12.08.21 um 05:23 schrieb Troy Conner:
>>         Also, the session id is contained in the Request/Request
>>         Headers. Do you think that's right?
>
>         That depends on your server implementation.
>
>         (I think you meant Request/Response) The Response header is
>         filled by the servers answer to your request. The Request
>         header is filled by the client (in this case JMeter).
>
>         If the session id is in the Response header, that usually
>         means, that the server has "approved" the value, that the
>         client sent. Can you show both headers?
>
>         Have you talked to the developers of the server software? Can
>         they tell you, how to correctly send the session id?
>
>         Felix
>
>>
>>         On Wed, Aug 11, 2021 at 8:20 PM Troy Conner
>>         <connert2017@gmail.com <ma...@gmail.com>> wrote:
>>
>>             when i put p=2000:24\:([^:]+) into the reg exp extractor
>>             the session id is part of the response data/response body
>>             for the debugger. Does this mean it's
>>             successfully extracting the session id? Below is the http
>>             request. Is this where I put the variable to point to the
>>             reg exp extractor?
>>
>>
>>             On Wed, Aug 11, 2021 at 7:22 PM Owen Pahl
>>             <owen.pahl@gmail.com <ma...@gmail.com>> wrote:
>>
>>                 Is the session ID in the Request header or the
>>                 Response header?
>>                 You can try adding more of the surrounding context to
>>                 minimise matching content that is not the target
>>                 value. eg. "p=2000:24\:([^:]+)", assuming the
>>                 "2000:24" prefix is constant.
>>
>>                 To use the captured value, you would insert a
>>                 variable reference in the desired location, "${sess}"
>>                 in this case.
>>                 JMeter will expand this reference with the value
>>                 contained in the variable.
>>
>>
>>                 Cheers,
>>                 Owen
>>
>>                 On Thu, 12 Aug 2021 at 14:03, Troy Conner
>>                 <connert2017@gmail.com
>>                 <ma...@gmail.com>> wrote:
>>
>>                     so i entered the below and now it's returning a
>>                     lot of data, none of which seem to be the session
>>                     id. Yes, the session id is in the header. what do
>>                     i put in the other requests to have them use that
>>                     extracted info?
>>
>>                     24\:([^:]+) and now it's returning a lot. 
>>
>>                     On Wed, Aug 11, 2021 at 6:28 PM Owen Pahl
>>                     <owen.pahl@gmail.com
>>                     <ma...@gmail.com>> wrote:
>>
>>                         You are missing a quantifier on the regex so
>>                         it only matches the first digit but that is
>>                         not followed by a colon so the entire match
>>                         fails (although you appear to have one in the
>>                         screen shot in your first email).
>>                         Try this regex "24\:([^:]+)". I find
>>                         https://regex101.com <https://regex101.com>
>>                         to be very useful in debugging/optimising
>>                         regex's.
>>
>>                         Also in the screen shot you have the
>>                         extractor set to get the value from the
>>                         request headers. Is that correct?
>>
>>
>>                         Cheers,
>>                         Owen
>>
>>                         On Thu, 12 Aug 2021 at 13:16, Troy Conner
>>                         <connert2017@gmail.com
>>                         <ma...@gmail.com>> wrote:
>>
>>                             When I add debug sampler after the Reg
>>                             Exp extractor it doesn't return any
>>                             values. Below is the header. I've
>>                             highlighted the session id in red, which
>>                             I added to the Reg exp extractor as
>>                             24:(.?): Shouldn't this work?
>>
>>                             Connection: keep-alive
>>                             Referer:
>>                             https://xxx.edu/pls/regis/f?p=2000:24
>>                             <https://xxx.edu/pls/regis/f?p=2000:24>:8764289093190:::::
>>                             Accept-Language: en-US,en;q=0.5
>>                             DNT: 1
>>                             Accept-Encoding: gzip, deflate, br
>>                             User-Agent: Mozilla/5.0 (X11; Linux
>>                             x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
>>                             Accept: text/css,*/*;q=0.1
>>                             Host: xxx.edu <http://xxx.edu>
>>
>>                             On Wed, Aug 11, 2021 at 5:35 PM Owen Pahl
>>                             <owen.pahl@gmail.com
>>                             <ma...@gmail.com>> wrote:
>>
>>                                 Hi Troy,
>>
>>                                 Are you using the captured value in
>>                                 the 2nd request?
>>                                 Have you confirmed the value is being
>>                                 captured correctly?
>>
>>                                 Adding a Debug Sampler to your test
>>                                 after the 1st request will let you
>>                                 see what value is being captured.
>>
>>                                 Then you'll need to add the value to
>>                                 your second request, the specifics
>>                                 will depend on the nature of your
>>                                 request but in general will either be
>>                                 added as a header via the Header
>>                                 Manager or a GET/POST parameter on
>>                                 the sampler directly.
>>                                 This section of the user manual may
>>                                 help https://jmeter.apache.org/usermanual/functions.html
>>                                 <https://jmeter.apache.org/usermanual/functions.html>
>>
>>
>>                                 Cheers,
>>                                 Owen
>>
>>                                 On Thu, 12 Aug 2021 at 11:09, Troy
>>                                 Conner <connert2017@gmail.com
>>                                 <ma...@gmail.com>> wrote:
>>
>>                                     i'm trying to connect from one
>>                                     site to another. The 2nd site
>>                                     assigns a session id to the
>>                                     header, however it's responding
>>                                     with with "session expired". I've
>>                                     added a reg exp extractor under
>>                                     the http request that looks like
>>                                     this. The session id comes after
>>                                     2000, but it doesn't work. How do
>>                                     i get and supply my session id to
>>                                     all http requests in my script?
>>
>>                                     image.png
>>

Re: problem with jmeter & session id's

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 17.08.21 um 05:06 schrieb Troy Conner:
> Hello, according to Oracle Jmeter will needs session id, page
> submission id, page items protected. It will also need username &
> password in json field. When I put a debugger sampler on the request
> it shows me the username and password, but I can't tell which
> parameter is retrieving this. According the video the username and
> password are hidden in the "p_json" value field, how do I extract
> that. I added the other parameters to the http request, except "p-debug."

I don't think, that you extract the password from the request. You
should know it upfront. Provide it directly using a user defined
variable or by a csv file and use a csv data set config.

Felix

>
> link to video
> https://www.youtube.com/watch?v=oCxVe0H_FPY
> <https://www.youtube.com/watch?v=oCxVe0H_FPY>
>
> parameters for my http request
> image.png
>
> MeterVariables: JMeterThread.last_sample_ok=true
> JMeterThread.pack=org.apache.jmeter.threads.SamplePackage@66e1806a
> START.HMS=152656 START.MS <http://START.MS>=1629152816026
> START.YMD=20210816 TESTSTART.MS <http://TESTSTART.MS>=1629166139083
> __jm__Loop Controller__idx=0 __jm__xxxxxxxx-xxxxxx, register,
> deregister, logout__idx=0 __jmeter.U_T__=Regis login, register,
> deregister, logout 1-1 __jmv_SAME_USER=true department_id1=597
> department_id2=597 department_id3=597 department_id4=597
> enrollment_status_id1=150
> lt=386230336636373263346632623338316665653463313236316237656639343035322e33342e3231382e373b6369745f617574682e6c6f67696e3b64613165303535326164306263306461636438323666643830613566353762633b323032312d30382d31362031393a30383a3539
> lt_1=386230336636373263346632623338316665653463313236316237656639343035322e33342e3231382e373b6369745f617574682e6c6f67696e3b64613165303535326164306263306461636438323666643830613566353762633b323032312d30382d31362031393a30383a3539
> lt_matchNr=1 offering_id1=83093 offering_id2=83097 offering_id3=83100
> offering_id4=83101 p_arg_names= p_flow_id=2000 p_flow_step_id=24
> p_instance=14723452403487 p_md5_checksum=
> p_page_submission_id=240291270312712850694836712927417792557
> password=xxxxxxxxx section_grade_system1=415087 section_id1=295544
> section_id2=295552 section_id3=295555 section_id4=295556
> site=xxxxxxxxxxxxxxxxx.edu <http://xxxxxxxxxxxxxxxxx.edu>
> term_option_id=527 total_units1=3 total_units2=3 total_units3=3
> total_units4=3 user=xxxxxxxx
>
>
>
>
> On Fri, Aug 13, 2021 at 1:24 AM Mariusz W <mawasak@gmail.com
> <ma...@gmail.com>> wrote:
>
>     Hi,
>     Troy, is this Test Plan created from recording proxy in JMeter?
>     Maybe session Id is not enough to make another steps in
>     application? Have You checked all constant values in request
>     headers/bodies?
>
>     Regards,
>     Mariusz
>
>
>     On Thu, 12 Aug 2021 at 15:36, Troy Conner <connert2017@gmail.com
>     <ma...@gmail.com>> wrote:
>
>         Hello Felix,
>         Thanks for the response. These screenshots may be able to help
>         you to see my problem better. Can you let me know what I need
>         to do to resolve this?
>
>         pic 1 - This is the http request. Do I add the "sess" from the
>         reg exp ext to this list? if so, can you send me an example of
>         how that should look when done?
>         image.png
>
>         pic 2 - expired session I'm seeing in sample results tree. I'm
>         trying to fix this problem
>         image.png
>
>         pic 3 - session id in the Request>request body of the sample
>         results tree
>         image.png
>
>         pic 3 - The app I'm working with is Oracle apex. this is how
>         it handles session id's. This is the url to this doc
>         https://docs.oracle.com/database/121/HTMDB/concept_ses.htm#HTMDB03009
>         <https://docs.oracle.com/database/121/HTMDB/concept_ses.htm#HTMDB03009>
>         image.png
>
>
>         On Thu, Aug 12, 2021 at 12:10 AM Felix Schumacher
>         <felix.schumacher@internetallee.de
>         <ma...@internetallee.de>> wrote:
>
>
>             Am 12.08.21 um 05:23 schrieb Troy Conner:
>>             Also, the session id is contained in the Request/Request
>>             Headers. Do you think that's right?
>
>             That depends on your server implementation.
>
>             (I think you meant Request/Response) The Response header
>             is filled by the servers answer to your request. The
>             Request header is filled by the client (in this case JMeter).
>
>             If the session id is in the Response header, that usually
>             means, that the server has "approved" the value, that the
>             client sent. Can you show both headers?
>
>             Have you talked to the developers of the server software?
>             Can they tell you, how to correctly send the session id?
>
>             Felix
>
>>
>>             On Wed, Aug 11, 2021 at 8:20 PM Troy Conner
>>             <connert2017@gmail.com <ma...@gmail.com>> wrote:
>>
>>                 when i put p=2000:24\:([^:]+) into the reg exp
>>                 extractor the session id is part of the response
>>                 data/response body for the debugger. Does this mean
>>                 it's successfully extracting the session id? Below is
>>                 the http request. Is this where I put the variable to
>>                 point to the reg exp extractor?
>>
>>
>>                 On Wed, Aug 11, 2021 at 7:22 PM Owen Pahl
>>                 <owen.pahl@gmail.com <ma...@gmail.com>> wrote:
>>
>>                     Is the session ID in the Request header or the
>>                     Response header?
>>                     You can try adding more of the surrounding
>>                     context to minimise matching content that is not
>>                     the target value. eg. "p=2000:24\:([^:]+)",
>>                     assuming the "2000:24" prefix is constant.
>>
>>                     To use the captured value, you would insert a
>>                     variable reference in the desired location,
>>                     "${sess}" in this case.
>>                     JMeter will expand this reference with the value
>>                     contained in the variable.
>>
>>
>>                     Cheers,
>>                     Owen
>>
>>                     On Thu, 12 Aug 2021 at 14:03, Troy Conner
>>                     <connert2017@gmail.com
>>                     <ma...@gmail.com>> wrote:
>>
>>                         so i entered the below and now it's returning
>>                         a lot of data, none of which seem to be the
>>                         session id. Yes, the session id is in the
>>                         header. what do i put in the other requests
>>                         to have them use that extracted info?
>>
>>                         24\:([^:]+) and now it's returning a lot. 
>>
>>                         On Wed, Aug 11, 2021 at 6:28 PM Owen Pahl
>>                         <owen.pahl@gmail.com
>>                         <ma...@gmail.com>> wrote:
>>
>>                             You are missing a quantifier on the regex
>>                             so it only matches the first digit but
>>                             that is not followed by a colon so the
>>                             entire match fails (although you appear
>>                             to have one in the screen shot in your
>>                             first email).
>>                             Try this regex "24\:([^:]+)". I find
>>                             https://regex101.com
>>                             <https://regex101.com> to be very useful
>>                             in debugging/optimising regex's.
>>
>>                             Also in the screen shot you have the
>>                             extractor set to get the value from the
>>                             request headers. Is that correct?
>>
>>
>>                             Cheers,
>>                             Owen
>>
>>                             On Thu, 12 Aug 2021 at 13:16, Troy Conner
>>                             <connert2017@gmail.com
>>                             <ma...@gmail.com>> wrote:
>>
>>                                 When I add debug sampler after the
>>                                 Reg Exp extractor it doesn't return
>>                                 any values. Below is the header. I've
>>                                 highlighted the session id in red,
>>                                 which I added to the Reg exp
>>                                 extractor as 24:(.?): Shouldn't this
>>                                 work?
>>
>>                                 Connection: keep-alive
>>                                 Referer:
>>                                 https://xxx.edu/pls/regis/f?p=2000:24
>>                                 <https://xxx.edu/pls/regis/f?p=2000:24>:8764289093190:::::
>>                                 Accept-Language: en-US,en;q=0.5
>>                                 DNT: 1
>>                                 Accept-Encoding: gzip, deflate, br
>>                                 User-Agent: Mozilla/5.0 (X11; Linux
>>                                 x86_64; rv:78.0) Gecko/20100101
>>                                 Firefox/78.0
>>                                 Accept: text/css,*/*;q=0.1
>>                                 Host: xxx.edu <http://xxx.edu>
>>
>>                                 On Wed, Aug 11, 2021 at 5:35 PM Owen
>>                                 Pahl <owen.pahl@gmail.com
>>                                 <ma...@gmail.com>> wrote:
>>
>>                                     Hi Troy,
>>
>>                                     Are you using the captured value
>>                                     in the 2nd request?
>>                                     Have you confirmed the value is
>>                                     being captured correctly?
>>
>>                                     Adding a Debug Sampler to your
>>                                     test after the 1st request will
>>                                     let you see what value is being
>>                                     captured.
>>
>>                                     Then you'll need to add the value
>>                                     to your second request, the
>>                                     specifics will depend on the
>>                                     nature of your request but in
>>                                     general will either be added as a
>>                                     header via the Header Manager or
>>                                     a GET/POST parameter on the
>>                                     sampler directly.
>>                                     This section of the user manual
>>                                     may
>>                                     help https://jmeter.apache.org/usermanual/functions.html
>>                                     <https://jmeter.apache.org/usermanual/functions.html>
>>
>>
>>                                     Cheers,
>>                                     Owen
>>
>>                                     On Thu, 12 Aug 2021 at 11:09,
>>                                     Troy Conner
>>                                     <connert2017@gmail.com
>>                                     <ma...@gmail.com>>
>>                                     wrote:
>>
>>                                         i'm trying to connect from
>>                                         one site to another. The 2nd
>>                                         site assigns a session id to
>>                                         the header, however it's
>>                                         responding with with "session
>>                                         expired". I've added a reg
>>                                         exp extractor under the http
>>                                         request that looks like this.
>>                                         The session id comes after
>>                                         2000, but it doesn't work.
>>                                         How do i get and supply my
>>                                         session id to all http
>>                                         requests in my script?
>>
>>                                         image.png
>>

Re: problem with jmeter & session id's

Posted by Troy Conner <co...@gmail.com>.
Hello, according to Oracle Jmeter will needs session id, page submission
id, page items protected. It will also need username & password in json
field. When I put a debugger sampler on the request it shows me the
username and password, but I can't tell which parameter is retrieving this.
According the video the username and password are hidden in the "p_json"
value field, how do I extract that. I added the other parameters to the
http request, except "p-debug."

link to video
https://www.youtube.com/watch?v=oCxVe0H_FPY

parameters for my http request
[image: image.png]

MeterVariables: JMeterThread.last_sample_ok=true
JMeterThread.pack=org.apache.jmeter.threads.SamplePackage@66e1806a
START.HMS=152656 START.MS=1629152816026 START.YMD=20210816
TESTSTART.MS=1629166139083
__jm__Loop Controller__idx=0 __jm__xxxxxxxx-xxxxxx, register, deregister,
logout__idx=0 __jmeter.U_T__=Regis login, register, deregister, logout 1-1
__jmv_SAME_USER=true department_id1=597 department_id2=597
department_id3=597 department_id4=597 enrollment_status_id1=150
lt=386230336636373263346632623338316665653463313236316237656639343035322e33342e3231382e373b6369745f617574682e6c6f67696e3b64613165303535326164306263306461636438323666643830613566353762633b323032312d30382d31362031393a30383a3539
lt_1=386230336636373263346632623338316665653463313236316237656639343035322e33342e3231382e373b6369745f617574682e6c6f67696e3b64613165303535326164306263306461636438323666643830613566353762633b323032312d30382d31362031393a30383a3539
lt_matchNr=1 offering_id1=83093 offering_id2=83097 offering_id3=83100
offering_id4=83101 p_arg_names= p_flow_id=2000 p_flow_step_id=24
p_instance=14723452403487 p_md5_checksum=
p_page_submission_id=240291270312712850694836712927417792557
password=xxxxxxxxx section_grade_system1=415087 section_id1=295544
section_id2=295552 section_id3=295555 section_id4=295556 site=
xxxxxxxxxxxxxxxxx.edu term_option_id=527 total_units1=3 total_units2=3
total_units3=3 total_units4=3 user=xxxxxxxx



On Fri, Aug 13, 2021 at 1:24 AM Mariusz W <ma...@gmail.com> wrote:

> Hi,
> Troy, is this Test Plan created from recording proxy in JMeter? Maybe
> session Id is not enough to make another steps in application? Have You
> checked all constant values in request headers/bodies?
>
> Regards,
> Mariusz
>
>
> On Thu, 12 Aug 2021 at 15:36, Troy Conner <co...@gmail.com> wrote:
>
>> Hello Felix,
>> Thanks for the response. These screenshots may be able to help you to see
>> my problem better. Can you let me know what I need to do to resolve this?
>>
>> pic 1 - This is the http request. Do I add the "sess" from the reg exp
>> ext to this list? if so, can you send me an example of how that should look
>> when done?
>> [image: image.png]
>>
>> pic 2 - expired session I'm seeing in sample results tree. I'm trying to
>> fix this problem
>> [image: image.png]
>>
>> pic 3 - session id in the Request>request body of the sample results tree
>> [image: image.png]
>>
>> pic 3 - The app I'm working with is Oracle apex. this is how it handles
>> session id's. This is the url to this doc
>> https://docs.oracle.com/database/121/HTMDB/concept_ses.htm#HTMDB03009
>> [image: image.png]
>>
>>
>> On Thu, Aug 12, 2021 at 12:10 AM Felix Schumacher <
>> felix.schumacher@internetallee.de> wrote:
>>
>>>
>>> Am 12.08.21 um 05:23 schrieb Troy Conner:
>>>
>>> Also, the session id is contained in the Request/Request Headers. Do you
>>> think that's right?
>>>
>>> That depends on your server implementation.
>>>
>>> (I think you meant Request/Response) The Response header is filled by
>>> the servers answer to your request. The Request header is filled by the
>>> client (in this case JMeter).
>>>
>>> If the session id is in the Response header, that usually means, that
>>> the server has "approved" the value, that the client sent. Can you show
>>> both headers?
>>>
>>> Have you talked to the developers of the server software? Can they tell
>>> you, how to correctly send the session id?
>>>
>>> Felix
>>>
>>>
>>> On Wed, Aug 11, 2021 at 8:20 PM Troy Conner <co...@gmail.com>
>>> wrote:
>>>
>>>> when i put p=2000:24\:([^:]+) into the reg exp extractor the session
>>>> id is part of the response data/response body for the debugger. Does this
>>>> mean it's successfully extracting the session id? Below is the http
>>>> request. Is this where I put the variable to point to the reg exp extractor?
>>>>
>>>>
>>>> On Wed, Aug 11, 2021 at 7:22 PM Owen Pahl <ow...@gmail.com> wrote:
>>>>
>>>>> Is the session ID in the Request header or the Response header?
>>>>> You can try adding more of the surrounding context to minimise
>>>>> matching content that is not the target value. eg. "p=2000:24\:([^:]+)",
>>>>> assuming the "2000:24" prefix is constant.
>>>>>
>>>>> To use the captured value, you would insert a variable reference in
>>>>> the desired location, "${sess}" in this case.
>>>>> JMeter will expand this reference with the value contained in the
>>>>> variable.
>>>>>
>>>>>
>>>>> Cheers,
>>>>> Owen
>>>>>
>>>>> On Thu, 12 Aug 2021 at 14:03, Troy Conner <co...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> so i entered the below and now it's returning a lot of data, none of
>>>>>> which seem to be the session id. Yes, the session id is in the header. what
>>>>>> do i put in the other requests to have them use that extracted info?
>>>>>>
>>>>>> 24\:([^:]+) and now it's returning a lot.
>>>>>>
>>>>>> On Wed, Aug 11, 2021 at 6:28 PM Owen Pahl <ow...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> You are missing a quantifier on the regex so it only matches the
>>>>>>> first digit but that is not followed by a colon so the entire match fails
>>>>>>> (although you appear to have one in the screen shot in your first email).
>>>>>>> Try this regex "24\:([^:]+)". I find https://regex101.com to be
>>>>>>> very useful in debugging/optimising regex's.
>>>>>>>
>>>>>>> Also in the screen shot you have the extractor set to get the value
>>>>>>> from the request headers. Is that correct?
>>>>>>>
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Owen
>>>>>>>
>>>>>>> On Thu, 12 Aug 2021 at 13:16, Troy Conner <co...@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> When I add debug sampler after the Reg Exp extractor it doesn't
>>>>>>>> return any values. Below is the header. I've highlighted the session id in
>>>>>>>> red, which I added to the Reg exp extractor as 24:(.?): Shouldn't this work?
>>>>>>>>
>>>>>>>> Connection: keep-alive
>>>>>>>> Referer: https://xxx.edu/pls/regis/f?p=2000:24:8764289093190:::::
>>>>>>>> Accept-Language: en-US,en;q=0.5
>>>>>>>> DNT: 1
>>>>>>>> Accept-Encoding: gzip, deflate, br
>>>>>>>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
>>>>>>>> Firefox/78.0
>>>>>>>> Accept: text/css,*/*;q=0.1
>>>>>>>> Host: xxx.edu
>>>>>>>>
>>>>>>>> On Wed, Aug 11, 2021 at 5:35 PM Owen Pahl <ow...@gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Hi Troy,
>>>>>>>>>
>>>>>>>>> Are you using the captured value in the 2nd request?
>>>>>>>>> Have you confirmed the value is being captured correctly?
>>>>>>>>>
>>>>>>>>> Adding a Debug Sampler to your test after the 1st request will let
>>>>>>>>> you see what value is being captured.
>>>>>>>>>
>>>>>>>>> Then you'll need to add the value to your second request, the
>>>>>>>>> specifics will depend on the nature of your request but in general will
>>>>>>>>> either be added as a header via the Header Manager or a GET/POST parameter
>>>>>>>>> on the sampler directly.
>>>>>>>>> This section of the user manual may help
>>>>>>>>> https://jmeter.apache.org/usermanual/functions.html
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>> Owen
>>>>>>>>>
>>>>>>>>> On Thu, 12 Aug 2021 at 11:09, Troy Conner <co...@gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> i'm trying to connect from one site to another. The 2nd site
>>>>>>>>>> assigns a session id to the header, however it's responding with
>>>>>>>>>> with "session expired". I've added a reg exp extractor under the http
>>>>>>>>>> request that looks like this. The session id comes after 2000, but it
>>>>>>>>>> doesn't work. How do i get and supply my session id to all http requests in
>>>>>>>>>> my script?
>>>>>>>>>>
>>>>>>>>>> [image: image.png]
>>>>>>>>>>
>>>>>>>>>

Re: problem with jmeter & session id's

Posted by Mariusz W <ma...@gmail.com>.
Hi,
Troy, is this Test Plan created from recording proxy in JMeter? Maybe
session Id is not enough to make another steps in application? Have You
checked all constant values in request headers/bodies?

Regards,
Mariusz


On Thu, 12 Aug 2021 at 15:36, Troy Conner <co...@gmail.com> wrote:

> Hello Felix,
> Thanks for the response. These screenshots may be able to help you to see
> my problem better. Can you let me know what I need to do to resolve this?
>
> pic 1 - This is the http request. Do I add the "sess" from the reg exp ext
> to this list? if so, can you send me an example of how that should look
> when done?
> [image: image.png]
>
> pic 2 - expired session I'm seeing in sample results tree. I'm trying to
> fix this problem
> [image: image.png]
>
> pic 3 - session id in the Request>request body of the sample results tree
> [image: image.png]
>
> pic 3 - The app I'm working with is Oracle apex. this is how it handles
> session id's. This is the url to this doc
> https://docs.oracle.com/database/121/HTMDB/concept_ses.htm#HTMDB03009
> [image: image.png]
>
>
> On Thu, Aug 12, 2021 at 12:10 AM Felix Schumacher <
> felix.schumacher@internetallee.de> wrote:
>
>>
>> Am 12.08.21 um 05:23 schrieb Troy Conner:
>>
>> Also, the session id is contained in the Request/Request Headers. Do you
>> think that's right?
>>
>> That depends on your server implementation.
>>
>> (I think you meant Request/Response) The Response header is filled by the
>> servers answer to your request. The Request header is filled by the client
>> (in this case JMeter).
>>
>> If the session id is in the Response header, that usually means, that the
>> server has "approved" the value, that the client sent. Can you show both
>> headers?
>>
>> Have you talked to the developers of the server software? Can they tell
>> you, how to correctly send the session id?
>>
>> Felix
>>
>>
>> On Wed, Aug 11, 2021 at 8:20 PM Troy Conner <co...@gmail.com>
>> wrote:
>>
>>> when i put p=2000:24\:([^:]+) into the reg exp extractor the session id
>>> is part of the response data/response body for the debugger. Does this mean
>>> it's successfully extracting the session id? Below is the http request. Is
>>> this where I put the variable to point to the reg exp extractor?
>>>
>>>
>>> On Wed, Aug 11, 2021 at 7:22 PM Owen Pahl <ow...@gmail.com> wrote:
>>>
>>>> Is the session ID in the Request header or the Response header?
>>>> You can try adding more of the surrounding context to minimise matching
>>>> content that is not the target value. eg. "p=2000:24\:([^:]+)", assuming
>>>> the "2000:24" prefix is constant.
>>>>
>>>> To use the captured value, you would insert a variable reference in the
>>>> desired location, "${sess}" in this case.
>>>> JMeter will expand this reference with the value contained in the
>>>> variable.
>>>>
>>>>
>>>> Cheers,
>>>> Owen
>>>>
>>>> On Thu, 12 Aug 2021 at 14:03, Troy Conner <co...@gmail.com>
>>>> wrote:
>>>>
>>>>> so i entered the below and now it's returning a lot of data, none of
>>>>> which seem to be the session id. Yes, the session id is in the header. what
>>>>> do i put in the other requests to have them use that extracted info?
>>>>>
>>>>> 24\:([^:]+) and now it's returning a lot.
>>>>>
>>>>> On Wed, Aug 11, 2021 at 6:28 PM Owen Pahl <ow...@gmail.com> wrote:
>>>>>
>>>>>> You are missing a quantifier on the regex so it only matches the
>>>>>> first digit but that is not followed by a colon so the entire match fails
>>>>>> (although you appear to have one in the screen shot in your first email).
>>>>>> Try this regex "24\:([^:]+)". I find https://regex101.com to be very
>>>>>> useful in debugging/optimising regex's.
>>>>>>
>>>>>> Also in the screen shot you have the extractor set to get the value
>>>>>> from the request headers. Is that correct?
>>>>>>
>>>>>>
>>>>>> Cheers,
>>>>>> Owen
>>>>>>
>>>>>> On Thu, 12 Aug 2021 at 13:16, Troy Conner <co...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> When I add debug sampler after the Reg Exp extractor it doesn't
>>>>>>> return any values. Below is the header. I've highlighted the session id in
>>>>>>> red, which I added to the Reg exp extractor as 24:(.?): Shouldn't this work?
>>>>>>>
>>>>>>> Connection: keep-alive
>>>>>>> Referer: https://xxx.edu/pls/regis/f?p=2000:24:8764289093190:::::
>>>>>>> Accept-Language: en-US,en;q=0.5
>>>>>>> DNT: 1
>>>>>>> Accept-Encoding: gzip, deflate, br
>>>>>>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
>>>>>>> Firefox/78.0
>>>>>>> Accept: text/css,*/*;q=0.1
>>>>>>> Host: xxx.edu
>>>>>>>
>>>>>>> On Wed, Aug 11, 2021 at 5:35 PM Owen Pahl <ow...@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi Troy,
>>>>>>>>
>>>>>>>> Are you using the captured value in the 2nd request?
>>>>>>>> Have you confirmed the value is being captured correctly?
>>>>>>>>
>>>>>>>> Adding a Debug Sampler to your test after the 1st request will let
>>>>>>>> you see what value is being captured.
>>>>>>>>
>>>>>>>> Then you'll need to add the value to your second request, the
>>>>>>>> specifics will depend on the nature of your request but in general will
>>>>>>>> either be added as a header via the Header Manager or a GET/POST parameter
>>>>>>>> on the sampler directly.
>>>>>>>> This section of the user manual may help
>>>>>>>> https://jmeter.apache.org/usermanual/functions.html
>>>>>>>>
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Owen
>>>>>>>>
>>>>>>>> On Thu, 12 Aug 2021 at 11:09, Troy Conner <co...@gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> i'm trying to connect from one site to another. The 2nd site
>>>>>>>>> assigns a session id to the header, however it's responding with
>>>>>>>>> with "session expired". I've added a reg exp extractor under the http
>>>>>>>>> request that looks like this. The session id comes after 2000, but it
>>>>>>>>> doesn't work. How do i get and supply my session id to all http requests in
>>>>>>>>> my script?
>>>>>>>>>
>>>>>>>>> [image: image.png]
>>>>>>>>>
>>>>>>>>

Re: problem with jmeter & session id's

Posted by Troy Conner <co...@gmail.com>.
Hello Felix,
Thanks for the response. These screenshots may be able to help you to see
my problem better. Can you let me know what I need to do to resolve this?

pic 1 - This is the http request. Do I add the "sess" from the reg exp ext
to this list? if so, can you send me an example of how that should look
when done?
[image: image.png]

pic 2 - expired session I'm seeing in sample results tree. I'm trying to
fix this problem
[image: image.png]

pic 3 - session id in the Request>request body of the sample results tree
[image: image.png]

pic 3 - The app I'm working with is Oracle apex. this is how it handles
session id's. This is the url to this doc
https://docs.oracle.com/database/121/HTMDB/concept_ses.htm#HTMDB03009
[image: image.png]


On Thu, Aug 12, 2021 at 12:10 AM Felix Schumacher <
felix.schumacher@internetallee.de> wrote:

>
> Am 12.08.21 um 05:23 schrieb Troy Conner:
>
> Also, the session id is contained in the Request/Request Headers. Do you
> think that's right?
>
> That depends on your server implementation.
>
> (I think you meant Request/Response) The Response header is filled by the
> servers answer to your request. The Request header is filled by the client
> (in this case JMeter).
>
> If the session id is in the Response header, that usually means, that the
> server has "approved" the value, that the client sent. Can you show both
> headers?
>
> Have you talked to the developers of the server software? Can they tell
> you, how to correctly send the session id?
>
> Felix
>
>
> On Wed, Aug 11, 2021 at 8:20 PM Troy Conner <co...@gmail.com> wrote:
>
>> when i put p=2000:24\:([^:]+) into the reg exp extractor the session id
>> is part of the response data/response body for the debugger. Does this mean
>> it's successfully extracting the session id? Below is the http request. Is
>> this where I put the variable to point to the reg exp extractor?
>>
>>
>> On Wed, Aug 11, 2021 at 7:22 PM Owen Pahl <ow...@gmail.com> wrote:
>>
>>> Is the session ID in the Request header or the Response header?
>>> You can try adding more of the surrounding context to minimise matching
>>> content that is not the target value. eg. "p=2000:24\:([^:]+)", assuming
>>> the "2000:24" prefix is constant.
>>>
>>> To use the captured value, you would insert a variable reference in the
>>> desired location, "${sess}" in this case.
>>> JMeter will expand this reference with the value contained in the
>>> variable.
>>>
>>>
>>> Cheers,
>>> Owen
>>>
>>> On Thu, 12 Aug 2021 at 14:03, Troy Conner <co...@gmail.com> wrote:
>>>
>>>> so i entered the below and now it's returning a lot of data, none of
>>>> which seem to be the session id. Yes, the session id is in the header. what
>>>> do i put in the other requests to have them use that extracted info?
>>>>
>>>> 24\:([^:]+) and now it's returning a lot.
>>>>
>>>> On Wed, Aug 11, 2021 at 6:28 PM Owen Pahl <ow...@gmail.com> wrote:
>>>>
>>>>> You are missing a quantifier on the regex so it only matches the first
>>>>> digit but that is not followed by a colon so the entire match fails
>>>>> (although you appear to have one in the screen shot in your first email).
>>>>> Try this regex "24\:([^:]+)". I find https://regex101.com to be very
>>>>> useful in debugging/optimising regex's.
>>>>>
>>>>> Also in the screen shot you have the extractor set to get the value
>>>>> from the request headers. Is that correct?
>>>>>
>>>>>
>>>>> Cheers,
>>>>> Owen
>>>>>
>>>>> On Thu, 12 Aug 2021 at 13:16, Troy Conner <co...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> When I add debug sampler after the Reg Exp extractor it doesn't
>>>>>> return any values. Below is the header. I've highlighted the session id in
>>>>>> red, which I added to the Reg exp extractor as 24:(.?): Shouldn't this work?
>>>>>>
>>>>>> Connection: keep-alive
>>>>>> Referer: https://xxx.edu/pls/regis/f?p=2000:24:8764289093190:::::
>>>>>> Accept-Language: en-US,en;q=0.5
>>>>>> DNT: 1
>>>>>> Accept-Encoding: gzip, deflate, br
>>>>>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
>>>>>> Firefox/78.0
>>>>>> Accept: text/css,*/*;q=0.1
>>>>>> Host: xxx.edu
>>>>>>
>>>>>> On Wed, Aug 11, 2021 at 5:35 PM Owen Pahl <ow...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Troy,
>>>>>>>
>>>>>>> Are you using the captured value in the 2nd request?
>>>>>>> Have you confirmed the value is being captured correctly?
>>>>>>>
>>>>>>> Adding a Debug Sampler to your test after the 1st request will let
>>>>>>> you see what value is being captured.
>>>>>>>
>>>>>>> Then you'll need to add the value to your second request, the
>>>>>>> specifics will depend on the nature of your request but in general will
>>>>>>> either be added as a header via the Header Manager or a GET/POST parameter
>>>>>>> on the sampler directly.
>>>>>>> This section of the user manual may help
>>>>>>> https://jmeter.apache.org/usermanual/functions.html
>>>>>>>
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Owen
>>>>>>>
>>>>>>> On Thu, 12 Aug 2021 at 11:09, Troy Conner <co...@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> i'm trying to connect from one site to another. The 2nd site
>>>>>>>> assigns a session id to the header, however it's responding with
>>>>>>>> with "session expired". I've added a reg exp extractor under the http
>>>>>>>> request that looks like this. The session id comes after 2000, but it
>>>>>>>> doesn't work. How do i get and supply my session id to all http requests in
>>>>>>>> my script?
>>>>>>>>
>>>>>>>> [image: image.png]
>>>>>>>>
>>>>>>>

Re: problem with jmeter & session id's

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 12.08.21 um 05:23 schrieb Troy Conner:
> Also, the session id is contained in the Request/Request Headers. Do
> you think that's right?

That depends on your server implementation.

(I think you meant Request/Response) The Response header is filled by
the servers answer to your request. The Request header is filled by the
client (in this case JMeter).

If the session id is in the Response header, that usually means, that
the server has "approved" the value, that the client sent. Can you show
both headers?

Have you talked to the developers of the server software? Can they tell
you, how to correctly send the session id?

Felix

>
> On Wed, Aug 11, 2021 at 8:20 PM Troy Conner <connert2017@gmail.com
> <ma...@gmail.com>> wrote:
>
>     when i put p=2000:24\:([^:]+) into the reg exp extractor the
>     session id is part of the response data/response body for the
>     debugger. Does this mean it's successfully extracting the session
>     id? Below is the http request. Is this where I put the variable to
>     point to the reg exp extractor?
>
>
>     On Wed, Aug 11, 2021 at 7:22 PM Owen Pahl <owen.pahl@gmail.com
>     <ma...@gmail.com>> wrote:
>
>         Is the session ID in the Request header or the Response header?
>         You can try adding more of the surrounding context to minimise
>         matching content that is not the target value. eg.
>         "p=2000:24\:([^:]+)", assuming the "2000:24" prefix is constant.
>
>         To use the captured value, you would insert a variable
>         reference in the desired location, "${sess}" in this case.
>         JMeter will expand this reference with the value contained in
>         the variable.
>
>
>         Cheers,
>         Owen
>
>         On Thu, 12 Aug 2021 at 14:03, Troy Conner
>         <connert2017@gmail.com <ma...@gmail.com>> wrote:
>
>             so i entered the below and now it's returning a lot of
>             data, none of which seem to be the session id. Yes, the
>             session id is in the header. what do i put in the other
>             requests to have them use that extracted info?
>
>             24\:([^:]+) and now it's returning a lot. 
>
>             On Wed, Aug 11, 2021 at 6:28 PM Owen Pahl
>             <owen.pahl@gmail.com <ma...@gmail.com>> wrote:
>
>                 You are missing a quantifier on the regex so it only
>                 matches the first digit but that is not followed by a
>                 colon so the entire match fails (although you appear
>                 to have one in the screen shot in your first email).
>                 Try this regex "24\:([^:]+)". I find
>                 https://regex101.com <https://regex101.com> to be very
>                 useful in debugging/optimising regex's.
>
>                 Also in the screen shot you have the extractor set to
>                 get the value from the request headers. Is that correct?
>
>
>                 Cheers,
>                 Owen
>
>                 On Thu, 12 Aug 2021 at 13:16, Troy Conner
>                 <connert2017@gmail.com <ma...@gmail.com>>
>                 wrote:
>
>                     When I add debug sampler after the Reg Exp
>                     extractor it doesn't return any values. Below is
>                     the header. I've highlighted the session id in
>                     red, which I added to the Reg exp extractor as
>                     24:(.?): Shouldn't this work?
>
>                     Connection: keep-alive
>                     Referer: https://xxx.edu/pls/regis/f?p=2000:24
>                     <https://xxx.edu/pls/regis/f?p=2000:24>:8764289093190:::::
>                     Accept-Language: en-US,en;q=0.5
>                     DNT: 1
>                     Accept-Encoding: gzip, deflate, br
>                     User-Agent: Mozilla/5.0 (X11; Linux x86_64;
>                     rv:78.0) Gecko/20100101 Firefox/78.0
>                     Accept: text/css,*/*;q=0.1
>                     Host: xxx.edu <http://xxx.edu>
>
>                     On Wed, Aug 11, 2021 at 5:35 PM Owen Pahl
>                     <owen.pahl@gmail.com <ma...@gmail.com>>
>                     wrote:
>
>                         Hi Troy,
>
>                         Are you using the captured value in the 2nd
>                         request?
>                         Have you confirmed the value is being captured
>                         correctly?
>
>                         Adding a Debug Sampler to your test after the
>                         1st request will let you see what value is
>                         being captured.
>
>                         Then you'll need to add the value to your
>                         second request, the specifics will depend on
>                         the nature of your request but in general will
>                         either be added as a header via the Header
>                         Manager or a GET/POST parameter on the sampler
>                         directly.
>                         This section of the user manual may
>                         help https://jmeter.apache.org/usermanual/functions.html
>                         <https://jmeter.apache.org/usermanual/functions.html>
>
>
>                         Cheers,
>                         Owen
>
>                         On Thu, 12 Aug 2021 at 11:09, Troy Conner
>                         <connert2017@gmail.com
>                         <ma...@gmail.com>> wrote:
>
>                             i'm trying to connect from one site to
>                             another. The 2nd site assigns a session id
>                             to the header, however it's responding
>                             with with "session expired". I've added a
>                             reg exp extractor under the http request
>                             that looks like this. The session id comes
>                             after 2000, but it doesn't work. How do i
>                             get and supply my session id to all http
>                             requests in my script?
>
>                             image.png
>

Re: problem with jmeter & session id's

Posted by Troy Conner <co...@gmail.com>.
Also, the session id is contained in the Request/Request Headers. Do you
think that's right?

On Wed, Aug 11, 2021 at 8:20 PM Troy Conner <co...@gmail.com> wrote:

> when i put p=2000:24\:([^:]+) into the reg exp extractor the session id
> is part of the response data/response body for the debugger. Does this mean
> it's successfully extracting the session id? Below is the http request. Is
> this where I put the variable to point to the reg exp extractor?
>
>
> On Wed, Aug 11, 2021 at 7:22 PM Owen Pahl <ow...@gmail.com> wrote:
>
>> Is the session ID in the Request header or the Response header?
>> You can try adding more of the surrounding context to minimise matching
>> content that is not the target value. eg. "p=2000:24\:([^:]+)", assuming
>> the "2000:24" prefix is constant.
>>
>> To use the captured value, you would insert a variable reference in the
>> desired location, "${sess}" in this case.
>> JMeter will expand this reference with the value contained in the
>> variable.
>>
>>
>> Cheers,
>> Owen
>>
>> On Thu, 12 Aug 2021 at 14:03, Troy Conner <co...@gmail.com> wrote:
>>
>>> so i entered the below and now it's returning a lot of data, none of
>>> which seem to be the session id. Yes, the session id is in the header. what
>>> do i put in the other requests to have them use that extracted info?
>>>
>>> 24\:([^:]+) and now it's returning a lot.
>>>
>>> On Wed, Aug 11, 2021 at 6:28 PM Owen Pahl <ow...@gmail.com> wrote:
>>>
>>>> You are missing a quantifier on the regex so it only matches the first
>>>> digit but that is not followed by a colon so the entire match fails
>>>> (although you appear to have one in the screen shot in your first email).
>>>> Try this regex "24\:([^:]+)". I find https://regex101.com to be very
>>>> useful in debugging/optimising regex's.
>>>>
>>>> Also in the screen shot you have the extractor set to get the value
>>>> from the request headers. Is that correct?
>>>>
>>>>
>>>> Cheers,
>>>> Owen
>>>>
>>>> On Thu, 12 Aug 2021 at 13:16, Troy Conner <co...@gmail.com>
>>>> wrote:
>>>>
>>>>> When I add debug sampler after the Reg Exp extractor it doesn't return
>>>>> any values. Below is the header. I've highlighted the session id in red,
>>>>> which I added to the Reg exp extractor as 24:(.?): Shouldn't this work?
>>>>>
>>>>> Connection: keep-alive
>>>>> Referer: https://xxx.edu/pls/regis/f?p=2000:24:8764289093190:::::
>>>>> Accept-Language: en-US,en;q=0.5
>>>>> DNT: 1
>>>>> Accept-Encoding: gzip, deflate, br
>>>>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
>>>>> Firefox/78.0
>>>>> Accept: text/css,*/*;q=0.1
>>>>> Host: xxx.edu
>>>>>
>>>>> On Wed, Aug 11, 2021 at 5:35 PM Owen Pahl <ow...@gmail.com> wrote:
>>>>>
>>>>>> Hi Troy,
>>>>>>
>>>>>> Are you using the captured value in the 2nd request?
>>>>>> Have you confirmed the value is being captured correctly?
>>>>>>
>>>>>> Adding a Debug Sampler to your test after the 1st request will let
>>>>>> you see what value is being captured.
>>>>>>
>>>>>> Then you'll need to add the value to your second request, the
>>>>>> specifics will depend on the nature of your request but in general will
>>>>>> either be added as a header via the Header Manager or a GET/POST parameter
>>>>>> on the sampler directly.
>>>>>> This section of the user manual may help
>>>>>> https://jmeter.apache.org/usermanual/functions.html
>>>>>>
>>>>>>
>>>>>> Cheers,
>>>>>> Owen
>>>>>>
>>>>>> On Thu, 12 Aug 2021 at 11:09, Troy Conner <co...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> i'm trying to connect from one site to another. The 2nd site assigns
>>>>>>> a session id to the header, however it's responding with with "session
>>>>>>> expired". I've added a reg exp extractor under the http request that looks
>>>>>>> like this. The session id comes after 2000, but it doesn't work. How do i
>>>>>>> get and supply my session id to all http requests in my script?
>>>>>>>
>>>>>>> [image: image.png]
>>>>>>>
>>>>>>

Re: problem with jmeter & session id's

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 12.08.21 um 05:20 schrieb Troy Conner:
> when i put p=2000:24\:([^:]+) into the reg exp extractor the session
> id is part of the response data/response body for the debugger. Does
> this mean it's successfully extracting the session id? Below is the
> http request. Is this where I put the variable to point to the reg exp
> extractor?

I don's see the http request. Have you included it here somewhere?

If you still use the same values in the regex extractor for the
template, the newly created JMeter variable should have the correct part
of the header as value.

Apart from that. Do you know, how to give the session id to your server?
You are extracting the id from the referer header, which is set
automatically by a browser with the URL, from which your request
originated (that refer(r)ed you to the new page). Maybe you don't have
to set a header, but rather give the parameter p with the value of the
complete value?

Felix


>
>
> On Wed, Aug 11, 2021 at 7:22 PM Owen Pahl <owen.pahl@gmail.com
> <ma...@gmail.com>> wrote:
>
>     Is the session ID in the Request header or the Response header?
>     You can try adding more of the surrounding context to minimise
>     matching content that is not the target value. eg.
>     "p=2000:24\:([^:]+)", assuming the "2000:24" prefix is constant.
>
>     To use the captured value, you would insert a variable reference
>     in the desired location, "${sess}" in this case.
>     JMeter will expand this reference with the value contained in the
>     variable.
>
>
>     Cheers,
>     Owen
>
>     On Thu, 12 Aug 2021 at 14:03, Troy Conner <connert2017@gmail.com
>     <ma...@gmail.com>> wrote:
>
>         so i entered the below and now it's returning a lot of data,
>         none of which seem to be the session id. Yes, the session id
>         is in the header. what do i put in the other requests to have
>         them use that extracted info?
>
>         24\:([^:]+) and now it's returning a lot. 
>
>         On Wed, Aug 11, 2021 at 6:28 PM Owen Pahl <owen.pahl@gmail.com
>         <ma...@gmail.com>> wrote:
>
>             You are missing a quantifier on the regex so it only
>             matches the first digit but that is not followed by a
>             colon so the entire match fails (although you appear to
>             have one in the screen shot in your first email).
>             Try this regex "24\:([^:]+)". I find https://regex101.com
>             <https://regex101.com> to be very useful in
>             debugging/optimising regex's.
>
>             Also in the screen shot you have the extractor set to get
>             the value from the request headers. Is that correct?
>
>
>             Cheers,
>             Owen
>
>             On Thu, 12 Aug 2021 at 13:16, Troy Conner
>             <connert2017@gmail.com <ma...@gmail.com>> wrote:
>
>                 When I add debug sampler after the Reg Exp extractor
>                 it doesn't return any values. Below is the header.
>                 I've highlighted the session id in red, which I added
>                 to the Reg exp extractor as 24:(.?): Shouldn't this work?
>
>                 Connection: keep-alive
>                 Referer: https://xxx.edu/pls/regis/f?p=2000:24
>                 <https://xxx.edu/pls/regis/f?p=2000:24>:8764289093190:::::
>                 Accept-Language: en-US,en;q=0.5
>                 DNT: 1
>                 Accept-Encoding: gzip, deflate, br
>                 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0)
>                 Gecko/20100101 Firefox/78.0
>                 Accept: text/css,*/*;q=0.1
>                 Host: xxx.edu <http://xxx.edu>
>
>                 On Wed, Aug 11, 2021 at 5:35 PM Owen Pahl
>                 <owen.pahl@gmail.com <ma...@gmail.com>> wrote:
>
>                     Hi Troy,
>
>                     Are you using the captured value in the 2nd request?
>                     Have you confirmed the value is being captured
>                     correctly?
>
>                     Adding a Debug Sampler to your test after the 1st
>                     request will let you see what value is being captured.
>
>                     Then you'll need to add the value to your second
>                     request, the specifics will depend on the nature
>                     of your request but in general will either be
>                     added as a header via the Header Manager or a
>                     GET/POST parameter on the sampler directly.
>                     This section of the user manual may
>                     help https://jmeter.apache.org/usermanual/functions.html
>                     <https://jmeter.apache.org/usermanual/functions.html>
>
>
>                     Cheers,
>                     Owen
>
>                     On Thu, 12 Aug 2021 at 11:09, Troy Conner
>                     <connert2017@gmail.com
>                     <ma...@gmail.com>> wrote:
>
>                         i'm trying to connect from one site to
>                         another. The 2nd site assigns a session id to
>                         the header, however it's responding with
>                         with "session expired". I've added a reg
>                         exp extractor under the http request that
>                         looks like this. The session id comes after
>                         2000, but it doesn't work. How do i get and
>                         supply my session id to all http requests in
>                         my script?
>
>                         image.png
>

Re: problem with jmeter & session id's

Posted by Troy Conner <co...@gmail.com>.
when i put p=2000:24\:([^:]+) into the reg exp extractor the session id is
part of the response data/response body for the debugger. Does this mean
it's successfully extracting the session id? Below is the http request. Is
this where I put the variable to point to the reg exp extractor?


On Wed, Aug 11, 2021 at 7:22 PM Owen Pahl <ow...@gmail.com> wrote:

> Is the session ID in the Request header or the Response header?
> You can try adding more of the surrounding context to minimise matching
> content that is not the target value. eg. "p=2000:24\:([^:]+)", assuming
> the "2000:24" prefix is constant.
>
> To use the captured value, you would insert a variable reference in the
> desired location, "${sess}" in this case.
> JMeter will expand this reference with the value contained in the variable.
>
>
> Cheers,
> Owen
>
> On Thu, 12 Aug 2021 at 14:03, Troy Conner <co...@gmail.com> wrote:
>
>> so i entered the below and now it's returning a lot of data, none of
>> which seem to be the session id. Yes, the session id is in the header. what
>> do i put in the other requests to have them use that extracted info?
>>
>> 24\:([^:]+) and now it's returning a lot.
>>
>> On Wed, Aug 11, 2021 at 6:28 PM Owen Pahl <ow...@gmail.com> wrote:
>>
>>> You are missing a quantifier on the regex so it only matches the first
>>> digit but that is not followed by a colon so the entire match fails
>>> (although you appear to have one in the screen shot in your first email).
>>> Try this regex "24\:([^:]+)". I find https://regex101.com to be very
>>> useful in debugging/optimising regex's.
>>>
>>> Also in the screen shot you have the extractor set to get the value from
>>> the request headers. Is that correct?
>>>
>>>
>>> Cheers,
>>> Owen
>>>
>>> On Thu, 12 Aug 2021 at 13:16, Troy Conner <co...@gmail.com> wrote:
>>>
>>>> When I add debug sampler after the Reg Exp extractor it doesn't return
>>>> any values. Below is the header. I've highlighted the session id in red,
>>>> which I added to the Reg exp extractor as 24:(.?): Shouldn't this work?
>>>>
>>>> Connection: keep-alive
>>>> Referer: https://xxx.edu/pls/regis/f?p=2000:24:8764289093190:::::
>>>> Accept-Language: en-US,en;q=0.5
>>>> DNT: 1
>>>> Accept-Encoding: gzip, deflate, br
>>>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
>>>> Firefox/78.0
>>>> Accept: text/css,*/*;q=0.1
>>>> Host: xxx.edu
>>>>
>>>> On Wed, Aug 11, 2021 at 5:35 PM Owen Pahl <ow...@gmail.com> wrote:
>>>>
>>>>> Hi Troy,
>>>>>
>>>>> Are you using the captured value in the 2nd request?
>>>>> Have you confirmed the value is being captured correctly?
>>>>>
>>>>> Adding a Debug Sampler to your test after the 1st request will let you
>>>>> see what value is being captured.
>>>>>
>>>>> Then you'll need to add the value to your second request, the
>>>>> specifics will depend on the nature of your request but in general will
>>>>> either be added as a header via the Header Manager or a GET/POST parameter
>>>>> on the sampler directly.
>>>>> This section of the user manual may help
>>>>> https://jmeter.apache.org/usermanual/functions.html
>>>>>
>>>>>
>>>>> Cheers,
>>>>> Owen
>>>>>
>>>>> On Thu, 12 Aug 2021 at 11:09, Troy Conner <co...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> i'm trying to connect from one site to another. The 2nd site assigns
>>>>>> a session id to the header, however it's responding with with "session
>>>>>> expired". I've added a reg exp extractor under the http request that looks
>>>>>> like this. The session id comes after 2000, but it doesn't work. How do i
>>>>>> get and supply my session id to all http requests in my script?
>>>>>>
>>>>>> [image: image.png]
>>>>>>
>>>>>

Re: problem with jmeter & session id's

Posted by Owen Pahl <ow...@gmail.com>.
Is the session ID in the Request header or the Response header?
You can try adding more of the surrounding context to minimise matching
content that is not the target value. eg. "p=2000:24\:([^:]+)", assuming
the "2000:24" prefix is constant.

To use the captured value, you would insert a variable reference in the
desired location, "${sess}" in this case.
JMeter will expand this reference with the value contained in the variable.


Cheers,
Owen

On Thu, 12 Aug 2021 at 14:03, Troy Conner <co...@gmail.com> wrote:

> so i entered the below and now it's returning a lot of data, none of which
> seem to be the session id. Yes, the session id is in the header. what do i
> put in the other requests to have them use that extracted info?
>
> 24\:([^:]+) and now it's returning a lot.
>
> On Wed, Aug 11, 2021 at 6:28 PM Owen Pahl <ow...@gmail.com> wrote:
>
>> You are missing a quantifier on the regex so it only matches the first
>> digit but that is not followed by a colon so the entire match fails
>> (although you appear to have one in the screen shot in your first email).
>> Try this regex "24\:([^:]+)". I find https://regex101.com to be very
>> useful in debugging/optimising regex's.
>>
>> Also in the screen shot you have the extractor set to get the value from
>> the request headers. Is that correct?
>>
>>
>> Cheers,
>> Owen
>>
>> On Thu, 12 Aug 2021 at 13:16, Troy Conner <co...@gmail.com> wrote:
>>
>>> When I add debug sampler after the Reg Exp extractor it doesn't return
>>> any values. Below is the header. I've highlighted the session id in red,
>>> which I added to the Reg exp extractor as 24:(.?): Shouldn't this work?
>>>
>>> Connection: keep-alive
>>> Referer: https://xxx.edu/pls/regis/f?p=2000:24:8764289093190:::::
>>> Accept-Language: en-US,en;q=0.5
>>> DNT: 1
>>> Accept-Encoding: gzip, deflate, br
>>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
>>> Firefox/78.0
>>> Accept: text/css,*/*;q=0.1
>>> Host: xxx.edu
>>>
>>> On Wed, Aug 11, 2021 at 5:35 PM Owen Pahl <ow...@gmail.com> wrote:
>>>
>>>> Hi Troy,
>>>>
>>>> Are you using the captured value in the 2nd request?
>>>> Have you confirmed the value is being captured correctly?
>>>>
>>>> Adding a Debug Sampler to your test after the 1st request will let you
>>>> see what value is being captured.
>>>>
>>>> Then you'll need to add the value to your second request, the specifics
>>>> will depend on the nature of your request but in general will either be
>>>> added as a header via the Header Manager or a GET/POST parameter on the
>>>> sampler directly.
>>>> This section of the user manual may help
>>>> https://jmeter.apache.org/usermanual/functions.html
>>>>
>>>>
>>>> Cheers,
>>>> Owen
>>>>
>>>> On Thu, 12 Aug 2021 at 11:09, Troy Conner <co...@gmail.com>
>>>> wrote:
>>>>
>>>>> i'm trying to connect from one site to another. The 2nd site assigns a
>>>>> session id to the header, however it's responding with with "session
>>>>> expired". I've added a reg exp extractor under the http request that looks
>>>>> like this. The session id comes after 2000, but it doesn't work. How do i
>>>>> get and supply my session id to all http requests in my script?
>>>>>
>>>>> [image: image.png]
>>>>>
>>>>

Re: problem with jmeter & session id's

Posted by Troy Conner <co...@gmail.com>.
so i entered the below and now it's returning a lot of data, none of which
seem to be the session id. Yes, the session id is in the header. what do i
put in the other requests to have them use that extracted info?

24\:([^:]+) and now it's returning a lot.

On Wed, Aug 11, 2021 at 6:28 PM Owen Pahl <ow...@gmail.com> wrote:

> You are missing a quantifier on the regex so it only matches the first
> digit but that is not followed by a colon so the entire match fails
> (although you appear to have one in the screen shot in your first email).
> Try this regex "24\:([^:]+)". I find https://regex101.com to be very
> useful in debugging/optimising regex's.
>
> Also in the screen shot you have the extractor set to get the value from
> the request headers. Is that correct?
>
>
> Cheers,
> Owen
>
> On Thu, 12 Aug 2021 at 13:16, Troy Conner <co...@gmail.com> wrote:
>
>> When I add debug sampler after the Reg Exp extractor it doesn't return
>> any values. Below is the header. I've highlighted the session id in red,
>> which I added to the Reg exp extractor as 24:(.?): Shouldn't this work?
>>
>> Connection: keep-alive
>> Referer: https://xxx.edu/pls/regis/f?p=2000:24:8764289093190:::::
>> Accept-Language: en-US,en;q=0.5
>> DNT: 1
>> Accept-Encoding: gzip, deflate, br
>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
>> Firefox/78.0
>> Accept: text/css,*/*;q=0.1
>> Host: xxx.edu
>>
>> On Wed, Aug 11, 2021 at 5:35 PM Owen Pahl <ow...@gmail.com> wrote:
>>
>>> Hi Troy,
>>>
>>> Are you using the captured value in the 2nd request?
>>> Have you confirmed the value is being captured correctly?
>>>
>>> Adding a Debug Sampler to your test after the 1st request will let you
>>> see what value is being captured.
>>>
>>> Then you'll need to add the value to your second request, the specifics
>>> will depend on the nature of your request but in general will either be
>>> added as a header via the Header Manager or a GET/POST parameter on the
>>> sampler directly.
>>> This section of the user manual may help
>>> https://jmeter.apache.org/usermanual/functions.html
>>>
>>>
>>> Cheers,
>>> Owen
>>>
>>> On Thu, 12 Aug 2021 at 11:09, Troy Conner <co...@gmail.com> wrote:
>>>
>>>> i'm trying to connect from one site to another. The 2nd site assigns a
>>>> session id to the header, however it's responding with with "session
>>>> expired". I've added a reg exp extractor under the http request that looks
>>>> like this. The session id comes after 2000, but it doesn't work. How do i
>>>> get and supply my session id to all http requests in my script?
>>>>
>>>> [image: image.png]
>>>>
>>>

Re: problem with jmeter & session id's

Posted by Owen Pahl <ow...@gmail.com>.
You are missing a quantifier on the regex so it only matches the first
digit but that is not followed by a colon so the entire match fails
(although you appear to have one in the screen shot in your first email).
Try this regex "24\:([^:]+)". I find https://regex101.com to be very useful
in debugging/optimising regex's.

Also in the screen shot you have the extractor set to get the value from
the request headers. Is that correct?


Cheers,
Owen

On Thu, 12 Aug 2021 at 13:16, Troy Conner <co...@gmail.com> wrote:

> When I add debug sampler after the Reg Exp extractor it doesn't return any
> values. Below is the header. I've highlighted the session id in red, which
> I added to the Reg exp extractor as 24:(.?): Shouldn't this work?
>
> Connection: keep-alive
> Referer: https://xxx.edu/pls/regis/f?p=2000:24:8764289093190:::::
> Accept-Language: en-US,en;q=0.5
> DNT: 1
> Accept-Encoding: gzip, deflate, br
> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
> Firefox/78.0
> Accept: text/css,*/*;q=0.1
> Host: xxx.edu
>
> On Wed, Aug 11, 2021 at 5:35 PM Owen Pahl <ow...@gmail.com> wrote:
>
>> Hi Troy,
>>
>> Are you using the captured value in the 2nd request?
>> Have you confirmed the value is being captured correctly?
>>
>> Adding a Debug Sampler to your test after the 1st request will let you
>> see what value is being captured.
>>
>> Then you'll need to add the value to your second request, the specifics
>> will depend on the nature of your request but in general will either be
>> added as a header via the Header Manager or a GET/POST parameter on the
>> sampler directly.
>> This section of the user manual may help
>> https://jmeter.apache.org/usermanual/functions.html
>>
>>
>> Cheers,
>> Owen
>>
>> On Thu, 12 Aug 2021 at 11:09, Troy Conner <co...@gmail.com> wrote:
>>
>>> i'm trying to connect from one site to another. The 2nd site assigns a
>>> session id to the header, however it's responding with with "session
>>> expired". I've added a reg exp extractor under the http request that looks
>>> like this. The session id comes after 2000, but it doesn't work. How do i
>>> get and supply my session id to all http requests in my script?
>>>
>>> [image: image.png]
>>>
>>

Re: problem with jmeter & session id's

Posted by Troy Conner <co...@gmail.com>.
When I add debug sampler after the Reg Exp extractor it doesn't return any
values. Below is the header. I've highlighted the session id in red, which
I added to the Reg exp extractor as 24:(.?): Shouldn't this work?

Connection: keep-alive
Referer: https://xxx.edu/pls/regis/f?p=2000:24:8764289093190:::::
Accept-Language: en-US,en;q=0.5
DNT: 1
Accept-Encoding: gzip, deflate, br
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Firefox/78.0
Accept: text/css,*/*;q=0.1
Host: xxx.edu

On Wed, Aug 11, 2021 at 5:35 PM Owen Pahl <ow...@gmail.com> wrote:

> Hi Troy,
>
> Are you using the captured value in the 2nd request?
> Have you confirmed the value is being captured correctly?
>
> Adding a Debug Sampler to your test after the 1st request will let you see
> what value is being captured.
>
> Then you'll need to add the value to your second request, the specifics
> will depend on the nature of your request but in general will either be
> added as a header via the Header Manager or a GET/POST parameter on the
> sampler directly.
> This section of the user manual may help
> https://jmeter.apache.org/usermanual/functions.html
>
>
> Cheers,
> Owen
>
> On Thu, 12 Aug 2021 at 11:09, Troy Conner <co...@gmail.com> wrote:
>
>> i'm trying to connect from one site to another. The 2nd site assigns a
>> session id to the header, however it's responding with with "session
>> expired". I've added a reg exp extractor under the http request that looks
>> like this. The session id comes after 2000, but it doesn't work. How do i
>> get and supply my session id to all http requests in my script?
>>
>> [image: image.png]
>>
>

Re: problem with jmeter & session id's

Posted by Owen Pahl <ow...@gmail.com>.
Hi Troy,

Are you using the captured value in the 2nd request?
Have you confirmed the value is being captured correctly?

Adding a Debug Sampler to your test after the 1st request will let you see
what value is being captured.

Then you'll need to add the value to your second request, the specifics
will depend on the nature of your request but in general will either be
added as a header via the Header Manager or a GET/POST parameter on the
sampler directly.
This section of the user manual may help
https://jmeter.apache.org/usermanual/functions.html


Cheers,
Owen

On Thu, 12 Aug 2021 at 11:09, Troy Conner <co...@gmail.com> wrote:

> i'm trying to connect from one site to another. The 2nd site assigns a
> session id to the header, however it's responding with with "session
> expired". I've added a reg exp extractor under the http request that looks
> like this. The session id comes after 2000, but it doesn't work. How do i
> get and supply my session id to all http requests in my script?
>
> [image: image.png]
>