Slavok wrote:

Try this peace of code:

<a href="/forum/login.php?action=out&id=<?= $forum_user['id']?>&csrf_token=<?= generate_form_token('logout'.$forum_user['id']) ?>">Logout</a>

Thank you, it worked! smile

hi,

My site uses PunBB. I wanted to put a logout link on my website outside the forum. I tried using this:

<a href="/forum/login.php?action=out&id=<?= $forum_user['id']?>&csrf_token=<?= echo generate_form_token(forum_link($forum_url['login'])) ?>">Logout</a>

But it throws me to the login page with the following confirmation:


Please confirm or cancel your last action

Unable to confirm security token. A likely cause for this is that some time passed between when you first entered the page and when you submitted a form or clicked a link. If that is the case and you would like to continue with your action, please click the Confirm button. Otherwise, you should click the Cancel button to return to where you were.

<confirm> <cancel>

How do I generate the csrf_token correctly?