This topic is locked

Saving SESSION variables at registration

3/26/2018 6:17:39 PM
PHPRunner General questions
H
headingwest author

Hi All,
I'm trying to invite users to the register page, so pass in parameters like:

/register.php?act=j&i=5ab8b03990581
I need to use the i=5ab8b03990581 in the "After registration" event, so I tried $_SESSION['refer'] = 5ab8b03990581
What I think I find is that all $_SESSION variables are reset immediately before "Before Registration" during the registration process.
So I can save a SESSION variable in "Register Before Process" but it's gone in the "Register Before Registration" event.
Any idea how to pass that variable or data through the events during registration process??
Thanks for your help

Sergey Kornilov admin 3/26/2018

Register page: BeforeProcess event:

if (!$_SESSION['refer'])

$_SESSION['refer'] = $_GET["i"];
H
headingwest author 3/26/2018

Thanks Sergey, but I need that SESSION data to go into the "Register: After Registration" event. From what I can see:
Before Process

-> SESSION[] = GET[] (this works)
Before Registration

-> SESSION[] is cleared and data lost
After Registration

-> userid is available

-> can't write SESSION[] into user record
I think at this stage I'll have to write the session data into a database table and then retrieve it. The invitation is secured by uniqid so should be able to make this work.