On Thu, Feb 14, 2002 at 07:43:28PM -0500, Philip Webb wrote:
> you need to supply your code in `patch -u' format:
OK, here's what I have (against 2.8.4 release).
However, I didn't change the docs (yet), nor add it to the
options menu or .lynxrc [there don't currently seem to be
any integer-valued options in there] and although I did
add it to the list of options in the lynx.cfg parser I
didn't add it to the lynx.cfg file...
imc
--- lynx2-8-4/src/LYGlobalDefs.h.cookie Sun Jul 8 02:30:13 2001
+++ lynx2-8-4/src/LYGlobalDefs.h Fri Dec 21 14:42:12 2001
@@ -385,6 +385,7 @@
extern BOOLEAN LYCollapseBRs; /* Collapse serial BRs? */
extern BOOLEAN LYSetCookies; /* Process Set-Cookie headers? */
extern BOOLEAN LYAcceptAllCookies; /* accept ALL cookies? */
+extern int LYSessionCookieTimeout; /* persistent session cookies? */
extern char *LYCookieAcceptDomains; /* domains to accept all cookies */
extern char *LYCookieRejectDomains; /* domains to reject all cookies */
extern char *LYCookieStrictCheckDomains; /* domains to check strictly */
--- lynx2-8-4/src/LYMain.c.cookie Sun Jul 8 02:30:13 2001
+++ lynx2-8-4/src/LYMain.c Fri Dec 21 14:51:16 2001
@@ -415,6 +415,7 @@
PUBLIC int AlertSecs; /* time-delay for HTAlert() messages */
PUBLIC int InfoSecs; /* time-delay for Information messages */
PUBLIC int LYMultiBookmarks = MULTI_BOOKMARK_SUPPORT;
+PUBLIC int LYSessionCookieTimeout = 0; /* persistent session cookies? */
PUBLIC int LYStatusLine = -1; /* Line for statusline() if > -1 */
PUBLIC int LYcols = DFT_COLS;
PUBLIC int LYlines = DFT_ROWS;
@@ -3603,6 +3604,10 @@
PARSE_FUN(
"selective", 4|FUNCTION_ARG, selective_fun,
"require .www_browsable files to browse directories"
+ ),
+ PARSE_INT(
+ "session_cookie_timeout", 4|NEED_INT_ARG, LYSessionCookieTimeout,
+ "=NUMBER\nturn session cookies into persistent ones with given\ntimeout in
+seconds"
),
PARSE_SET(
"short_url", 4|SET_ARG, long_url_ok,
--- lynx2-8-4/src/LYReadCFG.c.cookie Sun Jul 15 03:06:16 2001
+++ lynx2-8-4/src/LYReadCFG.c Fri Dec 21 15:13:27 2001
@@ -1441,6 +1441,7 @@
#endif
PARSE_SET("seek_frag_area_in_cur", LYSeekFragAREAinCur),
PARSE_SET("seek_frag_map_in_cur", LYSeekFragMAPinCur),
+ PARSE_TIM("session_cookie_timeout",LYSessionCookieTimeout),
PARSE_SET("set_cookies", LYSetCookies),
PARSE_SET("show_cursor", LYShowCursor),
PARSE_ENU("show_kb_rate", LYTransferRate, tbl_transfer_rate),
--- lynx2-8-4/src/LYCookie.c.cookie Mon Jun 11 02:04:20 2001
+++ lynx2-8-4/src/LYCookie.c Fri Dec 21 15:27:37 2001
@@ -1309,6 +1309,10 @@
if (cur_cookie->version < 1) {
cur_cookie->version = 1;
}
+ if (LYSessionCookieTimeout>0 && !(cur_cookie->flags &
+COOKIE_FLAG_EXPIRES_SET)) {
+ cur_cookie->expires = time(NULL) + LYSessionCookieTimeout;
+ cur_cookie->flags |= COOKIE_FLAG_EXPIRES_SET;
+ }
HTList_appendObject(CombinedCookies, cur_cookie);
} else if (cur_cookie != NULL) {
CTRACE((tfp,
@@ -1360,6 +1364,10 @@
if (cur_cookie->version < 1) {
cur_cookie->version = 1;
}
+ if (LYSessionCookieTimeout>0 && !(cur_cookie->flags &
+COOKIE_FLAG_EXPIRES_SET)) {
+ cur_cookie->expires = time(NULL) + LYSessionCookieTimeout;
+ cur_cookie->flags |= COOKIE_FLAG_EXPIRES_SET;
+ }
HTList_appendObject(CombinedCookies, cur_cookie);
} else if (cur_cookie != NULL && !invalidport) {
CTRACE((tfp, "LYProcessSetCookies: Rejecting Set-Cookie2: %s=%s\n",
@@ -1818,6 +1826,10 @@
}
cur_cookie->quoted = TRUE;
}
+ if (LYSessionCookieTimeout>0 && !(cur_cookie->flags &
+COOKIE_FLAG_EXPIRES_SET)) {
+ cur_cookie->expires = time(NULL) + LYSessionCookieTimeout;
+ cur_cookie->flags |= COOKIE_FLAG_EXPIRES_SET;
+ }
HTList_appendObject(CombinedCookies, cur_cookie);
} else if (cur_cookie != NULL) {
CTRACE((tfp, "LYProcessSetCookies: Rejecting Set-Cookie: %s=%s\n",
@@ -1860,6 +1872,10 @@
cur_cookie->version = 1;
}
cur_cookie->quoted = TRUE;
+ }
+ if (LYSessionCookieTimeout>0 && !(cur_cookie->flags &
+COOKIE_FLAG_EXPIRES_SET)) {
+ cur_cookie->expires = time(NULL) + LYSessionCookieTimeout;
+ cur_cookie->flags |= COOKIE_FLAG_EXPIRES_SET;
}
HTList_appendObject(CombinedCookies, cur_cookie);
} else if (cur_cookie != NULL) {