timekeeper

My first (abandoned unfinished) web application for time tracking
git clone git://jacobedwards.org/timekeeper
Log | Files | Refs | README

logout.c (374B)


      1 #include "common.h"
      2 #include "pages.h"
      3 
      4 enum kcgi_err
      5 pagelogout(struct pagedata *pd)
      6 {
      7 	enum kcgi_err status;
      8 
      9 	if (!pd->user)
     10 		return errorpage(pd, KHTTP_500);
     11 
     12 	if ((status = khttp_head(&pd->req, kresps[KRESP_SET_COOKIE],
     13 	    "%s=; Path=/", pd->keys[KeyHash].name)) != KCGI_OK)
     14 		return status;
     15 	return redirect(pd, pd->pages[PageIndex], "You are being logged out");
     16 }