Forums

CF6 session value on redirect doesn't work (and data builder explanation)

gix.vax 13 Oct, 2019
HI
I have a custom code in a block that save "smscode" in session in this way
\GApp::session()->set("smscode", $smscode);

if i test session smscode in a "Message" box in this form it works
message box : Your code is {session:smscode}
i can see : Your code is 052867
that is correct

but after a redirect to other form, the same code doesn't show the code (something happen in session?)
Message box: Your code is {session:smscode}
result : Your code is

redirect works and have this form : https/www.mysite.it/index.php?option=com_chronoforms6&chronoform=sms-conferma

p.s.
i can't understand how data builder works, is a bit confusing for me
want put data:smscode in smscode in session to retrieve after
i put :
Type: Session (in dropdown)
name : smscode (what is this? value name to put in session? right?)
value : {var:smscode} (i've tried data:smscode and var:varname.var too)
healyhatman 13 Oct, 2019
name: yes, that would be the NAME of the value.

{data:} is for form data
{var:} is for form actions like "switch" or "read data"

So use whichever is appropriate for your situation
This topic is locked and no more replies can be posted.