[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev Cookie problems?
From: |
brian j. pardy |
Subject: |
Re: lynx-dev Cookie problems? |
Date: |
Fri, 25 Sep 1998 18:29:24 -0700 |
Larry W. Virden wrote:
> > When I try to access http://www.medscape.com/ with its cookie saved, Lynx
> > says "Alert!: HTTP/1.1 400 Bad Request". When I delete the cookie I can
> > access the site and login manually.
>
> Is it safe to assume that 2.8.1 formal will remain on hold until this
> situation is resolved?
I think this fixes part or all of the problem.
Laura, could you try this on shopping.com, and Heikki on IMDB?
Against pre2.
fgets() was leaving a newline at the end of each cookie read from the
persistent cookie file, this patch removes the newline at the end.
When a domain had more than one cookie, Lynx was improperly sending the
cookie headers. Where it should be sending:
Cookie: IMDB[blah]=BLAHBLAHBLAH; IMDB2=BLAH2
Lynx was sending:
Cookie: IMDB[blah]=BLAHBLAHBLAH
; IMDB2=BLAH2
This rightfully confused some servers. I think www.slashdot.org was
working properly for me because I only had one cookie from them.
diff -cr 2.8.1pre.2/src/LYCookie.c 2.8.1pre.2.bri/src/LYCookie.c
*** 2.8.1pre.2/src/LYCookie.c Thu Sep 17 03:43:48 1998
--- 2.8.1pre.2.bri/src/LYCookie.c Fri Sep 25 18:24:54 1998
***************
*** 1857,1862 ****
--- 1857,1863 ----
while (!feof(cookie_handle)) {
cookie *moo;
+ int i = 0;
int tok_loop;
char *tok_out, *tok_ptr;
char *j;
***************
*** 1866,1871 ****
--- 1867,1883 ----
if((j == NULL) || (buf[0] == '\0' || buf[0] == '\n')) {
continue;
}
+
+
+ /*
+ * Strip out the newline that fgets() puts at the end of a
+ * cookie.
+ */
+
+ while(buf[i] != '\n' && i < sizeof(buf)) {
+ i++;
+ }
+ buf[i] = '\0';
/*
* Tokenise the cookie line into its component parts -
--
When confronted by a difficult problem, you can solve it more easily by
reducing it to the question, "How would the Lone Ranger handle this?"