I am not able to retrieve the value of a session variable in a php custom code module. I have set up a session variable named xx_srch_surname in a form. When I redirect to another form, I execute a php custom code, which shows the value of the session data using print_r($_SESSION), and my variable name and its value appear. But if I try to echo the variable using $_SESSION['xx_srch_surname'] or $session->data['xx_srch_surname'], the variable is empty. What is the correct format to reference this variable from php custom code?
Hope someone can help.
you set the variable in one form and try to get it in a different form or a different form page ?
Yes, that is correct. I set it in one form and need to get it in a different form, but it comes up empty in the second form.
You can print the whole $_SESSION global variable to find the path to the variable you need
in v8 you can use:
ChronoSession::get("var_name", default);
or
{session:var_name default} in form settings