LPH
Well-known member
I'm trying to build a logout form on an external page.
This returns a security error even if I remove the xfConfirm. I used to have a direct link to the XenForo logout page but had to always click on confirm so I'm trying to work around it.
Do you have any suggestions on a logout form so that there is no security error and there is no need to confirm?
PHP:
<form action="<?php echo XenForo_Application::get('options')->boardUrl; ?>/logout" method="post" id="pageLogout">
<div class="ctrlWrapper">
<dl class="ctrlUnit">
<dt></dt>
<dd>
<input type="submit" class="xenword_logout logout" value="log out" />
</dd>
</dl>
</div>
<input type="hidden" name="cookie_check" value="1" />
<input type="hidden" name="redirect" value="<?php $post = ''; get_permalink( $post->ID ); ?>" />
<input type="hidden" name="_xfToken" value="$visitor.csrf_token_page " />
<input type="hidden" name="_xfConfirm" value="1" />
</form>
This returns a security error even if I remove the xfConfirm. I used to have a direct link to the XenForo logout page but had to always click on confirm so I'm trying to work around it.
Do you have any suggestions on a logout form so that there is no security error and there is no need to confirm?