Logout without using token and redirect to login page

Permalink
Hi,

I am new with c5 and I am creating an installation with embedded c5 with vanilla forum using jsconnect.

I need to pass a url in vanilla for logout in c5, but I see that c5 default logout url is passing token to logout url. What is the best way to get a url for logout without passing the token and achieve logout process with redirect to login form after that?

If i can use /login/logout url without token, then will be better as it is used by default

I tried with single_page functionality without using a controller. I have just view.php with following code:

{code}
$loggedIn = User::isLoggedIn();

$user = new User();

if ($loggedIn) {
$user->logout();
}
{/code}

This works ok and i get logged out, but how to do the redirect after that? Maybe i have to use a controller instead?

Thank you in advance,
anebi

 
anebi replied on at Permalink Reply
PS: I could use header() function for redirect actually. In any case maybe there is better way to achieve this. Let me know your opinions.
anebi replied on at Permalink Reply
I found another solution to my problem and problem is solved.