D
D
Dmax992021-09-08 13:04:05
opencart
Dmax99, 2021-09-08 13:04:05

How to add link part after Token?

Hi friends! Please tell me how to add part of the link after the token. I don't understand how this can be done.

'href'     => $this->url->link('catalog/category', 'user_token=' . $this->session->data['user_token'], true),

it turns out a token at the end, and you need to put a slash and your word ...
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
opencartbot, 2021-09-13
@opencartbot

Like this:

'href'     => $this->url->link('catalog/category', 'user_token=' . $this->session->data['user_token'] . '/bla-bla-bla', true),

But if you do this, add a slash as a separator, then after clicking on such a link, the admin user will be logged out, because everything that you added is attached to the user_token get variable, so checking the token will not find such a value in the session.
The correct thing to do is:
'href'     => $this->url->link('catalog/category', 'user_token=' . $this->session->data['user_token'] . '&foo=bar', true),

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question