-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<HTML>
- <HEAD>
- <TITLE>
- <% mt('Logout page') |h %>
- </TITLE>
- </HEAD>
- <BODY>
- <BR><BR>
- <CENTER>
- <% mt('You have logged out') |h %>
- </CENTER>
- <BR><BR>
- <CENTER>
- Return to <a href="..">freeside</a>
- </CENTER>
- </BODY>
-</HTML>
+<% $cgi->redirect($redirect) %>
+<%init>
+
+# Delete the server-side session
+$FS::CurrentUser::CurrentSession->logout;
+
+# Delete the browser cookie, etc.
+my $auth_type = $r->auth_type;
+$auth_type->logout($r);
+
+my $redirect = $fsurl; #.'?logout=logout';
+
+</%init>