1:- module(logout, []).
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)]) 18 ]),
19 http_session_retractall(user(_User)),
20 http_redirect(see_other, Return, Request).
implement the logout page
/