I want to offer a Logoutbutton in the FrontEnd.
I’d like to do via an ajax call.
The Member::logout is deprecated->Security::setCurrentUser(null)
-> that function has no effect
APi-docs tell me I could use SIlverStripe\Security\Security::logOut()
but if I call that function via URL I get an error…
Uncaught Exception Error: "Using $this when not in object context" at ...\site\vendor\silverstripe\framework\src\Security\Security.php line 726
Does anybody has a working solution for LogOut a User without the standard logout-page?
Thanks in advance