1:- module(logout, []).

implement the logout page

/

    6:- use_module(library(http/http_dispatch)).    7:- use_module(library(http/http_client)).    8:- use_module(library(http/http_session)).    9:- use_module(library(http/http_parameters)).   10
   11:-http_handler(login(logout), logout_handler, [id(logout), identity(guest), priority(-100)]).   12
   13logout_handler(Request) :-
   14    http_location_by_id(home, Redirect),
   15    http_parameters(
   16        Request,
   17        [ referer(Return, [default(Redirect)])   % TODO check this
   18        ]),
   19    http_session_retractall(user(_User)),
   20    http_redirect(see_other, Return, Request).
   21% TODO expire remember_me cookie on logout