Skip to content

Extracting and using a Cookie value

Hi,

How can I extract a value from a cookie and re-use it in another step? I need to extract a cookie value from the registration step and then use it in the login step. At the moment what’s happening is that the cookie value in the registration step is different than the value in the login step, so the submission is failing.

The cookie value i want to extract is the session_org value

Cookies:
session_org=8e01fd555bc8d8ca480c466f09cdfc82

I tried to do the following but it didn't work

[cookie_extract]
type=extract
front= session_org
back=  
static=2

[REGISTER_STEP1]
cookie=%cookie_extract%

[LOGIN_STEP1]
set cookie=%cookie_extract%
just download=1

Also, do I have to remove the cookie before adding the new value?

Thanks.

Comments

  • SvenSven www.GSA-Online.de
    edited September 2015
    [cookie_extract]
    type=extract
    default=%cookie-session_org
    static=2 however you need to trigger the even to use this %cookie_extract% in one way for the registration step, else it is not saved ... maybe with a dummy step like set cookie=session_org=%cookie_extract% which will just extract the same value as it will set it. [LOGIN_STEP1] set cookie=session_org=%cookie_extract%
Sign In or Register to comment.