A
A
Adik Izat2020-11-02 15:19:12
opencart
Adik Izat, 2020-11-02 15:19:12

How to set the session correctly in Opencart3 so that it can be pulled out in the header?

Good day, forum users. I am making a project on which there are no separate pages for registration and login, they are in popups. Not the point, in general, I left the registration script the same as the registration itself. Only now, if there is an Error in the completed form, you need to pull it out in the header inside the notification block.
It turns out that I tried to write in the registration controller: and After both manipulations in the header controller, I did var_dump($this->session->data). There is no "reg_error" key in the array. It turns out that I set the session incorrectly. And how exactly do you need to set the session itself?
$_SESSION['reg_error'] = $this->error;
$this->session->data['reg_error'] = $this->error;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question