chiark / gitweb /
never set an expired cookie; on logout, re-login as guest
[disorder] / server / cgimain.c
index 5acf9ea5208494e9e20f3b281d7d609d7286490b..ec63bf8188ed0ab2e55d453263f4bbad23ef7e28 100644 (file)
@@ -116,6 +116,9 @@ int main(int argc, char **argv) {
     disorder_cgi_error(&output, &s, "connect");
     return 0;
   }
+  /* If there was a cookie but it went bad, we forget it */
+  if(login_cookie && !strcmp(disorder_user(g.client), "guest"))
+    login_cookie = 0;
   /* TODO RFC 3875 s8.2 recommendations e.g. concerning PATH_INFO */
   disorder_cgi(&output, &s);
   if(fclose(stdout) < 0) fatal(errno, "error closing stdout");