XF 2.2 Session value is NULL

RisteDimitrievski

Active member
I've creating metamask sessions via Ajax,

PHP:
\XF::session()->set('metamask_id',$data);
return $this->apiResult(['code' => 201, 'message' => $data]);

And extended user registration process (\XF\Pub\Controller\Register)
PHP:
 public function finalizeRegistration(\XF\Entity\User $user)
    {
        $user->set('metamask_id', \XF::session()->get('metamask_id'));
        $user->save();
        parent::finalizeRegistration($user); // TODO: Change the autogenerated stub
    }

And i get the following error:
InvalidArgumentException: Attempted to convert NULL to string/binary [metamask_id] in src\XF\Mvc\Entity\Entity.php at line 763
Any idea how to access to XF session i've created with ajax request??
 
Top