This question comes from an absolute non-coder - and has been asked in various forms several times befor (e.g. here).
To logout properly the URL that triggers it needs a nonce as e.g.:
We can get the nonce as described in the codex. BUT: what if I have to trigger a logout is by using a URL. More precisely: my CiviCRM plugin has forms that people can fill out and once completed let the user redirect somewhere else -> e.g. log out and go to another page. I can copy/paste the redirct URL in a form such as
-> how do I get the nonce where it is supposed to go - or are there alternatives???