mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Mode cookies expire after ten years
SVN revision: 1497
This commit is contained in:
parent
75a3ba9508
commit
49e0743d8e
11
src/elogd.c
11
src/elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.759 2005/10/05 11:37:57 ritt
|
||||||
|
Mode cookies expire after ten years
|
||||||
|
|
||||||
Revision 1.758 2005/10/05 11:29:16 ritt
|
Revision 1.758 2005/10/05 11:29:16 ritt
|
||||||
Show 'top text' in edit form
|
Show 'top text' in edit form
|
||||||
|
|
||||||
@ -7283,7 +7286,10 @@ void set_cookie(LOGBOOK * lbs, char *name, char *value, BOOL global, char *expir
|
|||||||
else
|
else
|
||||||
strcpy(lb_name, "global");
|
strcpy(lb_name, "global");
|
||||||
|
|
||||||
|
if (value != NULL)
|
||||||
rsprintf("Set-Cookie: %s=%s;", name, value);
|
rsprintf("Set-Cookie: %s=%s;", name, value);
|
||||||
|
else
|
||||||
|
rsprintf("Set-Cookie: %s;", name);
|
||||||
|
|
||||||
/* add path */
|
/* add path */
|
||||||
if (global) {
|
if (global) {
|
||||||
@ -7310,7 +7316,7 @@ void set_cookie(LOGBOOK * lbs, char *name, char *value, BOOL global, char *expir
|
|||||||
exp = atof(expiration);
|
exp = atof(expiration);
|
||||||
|
|
||||||
/* to clear a cookie, set expiration date to yesterday */
|
/* to clear a cookie, set expiration date to yesterday */
|
||||||
if (value[0] == 0)
|
if (value != NULL && value[0] == 0)
|
||||||
exp = -24;
|
exp = -24;
|
||||||
|
|
||||||
/* add expriation date */
|
/* add expriation date */
|
||||||
@ -7546,7 +7552,8 @@ void show_http_header(LOGBOOK * lbs, BOOL expires, char *cookie)
|
|||||||
rsprintf("Content-Type: text/html;charset=%s\r\n", DEFAULT_HTTP_CHARSET);
|
rsprintf("Content-Type: text/html;charset=%s\r\n", DEFAULT_HTTP_CHARSET);
|
||||||
|
|
||||||
if (cookie && cookie[0]) {
|
if (cookie && cookie[0]) {
|
||||||
rsprintf("Set-Cookie: %s;", cookie);
|
|
||||||
|
set_cookie(lbs, cookie, NULL, FALSE, "99999"); /* ten years by default */
|
||||||
|
|
||||||
if (getcfg(lbs->name, "URL", str, sizeof(str))) {
|
if (getcfg(lbs->name, "URL", str, sizeof(str))) {
|
||||||
extract_path(str);
|
extract_path(str);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user