static void logoutServiceProc(Webs *wp) { assure(wp); websRemoveSessionVar(wp, WEBS_SESSION_USERNAME); if (smatch(wp->authType, "basic") || smatch(wp->authType, "digest")) { websError(wp, HTTP_CODE_UNAUTHORIZED, "Logged out."); return; } websRedirectByStatus(wp, HTTP_CODE_OK); }
PUBLIC bool websLogoutUser(Webs *wp) { assert(wp); websRemoveSessionVar(wp, WEBS_SESSION_USERNAME); if (smatch(wp->authType, "basic") || smatch(wp->authType, "digest")) { websError(wp, HTTP_CODE_UNAUTHORIZED, "Logged out."); return 0; } websRedirectByStatus(wp, HTTP_CODE_OK); return 1; }