Article delegate-en/373 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[Reference:<_A370@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: Cookies in DeleGate
24 Mar 1999 08:37:10 GMT ysato@etl.go.jp (Yutaka Sato)


On 03/23/99(09:48) you pjuaqbdyi-vhnmk2byegtr.ml@ml.delegate.org wrote
in <_A370@delegate-en.ML_>
 |I've been reading the delegate sources trying to
 |figure out what delegate does with cookies.
 |
 |I see several functions dealing with cookies
 |in http.c and httphead.c, and I see references
 |to cookies in the logs.
 |
 |Also, delegate sometimes sets cookies like
 |"delegate.server.edu   FALSE   /  FALSE   942189149     
 |  NGUserIDcdbcf705-25484-924147105-1"

As long as I know, DeleGate does not generate any Cookie by
itself, and I've never seen such Cookie like above.

 |Furthermore, sometimes I see cookies of the form
 |"delegate.server.edu FALSE   /-_-http://www.acme.com/cgi-bin ..."
 |indicating that delegate is just rewriting cookies with
 |the domain and toplevel directory changed appropriately
 |to reflect url-rewriting.
 |
 |However, some cookie-based sites don't work at all with
 |delegate (eg, www.nytimes.com) so it doesn't look
 |like cookies are always being reset properly.  And it
 |looks like other sites that normally set cookies don't leave
 |any on the client side. 
 |
 |Sorry if this is an obtuse question, but what does
 |delegate do with cookies?  And what is the purpose
 |of the first cookie described above?

I'd like to know in which way you are using DeleGate.

 1) as a standard HTTP proxy
 2) as if it's an origin server with MOUNTs
 3) as if it's an origin server with "/-_-" notation

In any case, DeleGate disables caching if a Cookie/Set-Cookie is
included in request and/or response message.
And when it used as 1) it does not rewrite any Cookies.
When it is used as 2) with
  MOUNT="/S/* http://SERVER/PATH/*"
for example, DeleGate rewrites
  "domain=SERVER; path=/PATH"
attributes in Set-Cookie field in a response message to
  "domain=DELEGATE; path=/S/"
so that clients will send the Cookie when accessing to
  "http://DELEGATE/S/*"
This is consistent with other URL rewritings for response
messages which rewrites any URL start with
   http://SERVER/PATH/
to one start with
   http://DELEGATE/S/
I think you know the necessity of rewriting for Set-Cookie if
you know how clients select Cookies based on "domain" and "path".
(See http://www.netscape.com/newsref/std/cookie_spec.html)
When it is used as 3), like 2) such rewriting from
   "domain=SERVER; path=/PATH"
to "domain=DELEGATE; path=/-_-http://SERVER/PATH/"
should have been done, but I forgot to care this case.
It should be done with extension like the patch enclosed.

I tested relaying Cookie in each mode like follows and saw
that a cookie given by the server in the Set-Cookie response
header is sent from the client in Cookie request header.
("DeleGateHost" below was in FQDN form)

1) delegated -v -P8080
   client -> http://www.nytimes.com/
   with proxy setting [DeleGateHost:8080]

2) delegated -v -P8080 MOUNT="/nytimes/* http://www.nytimes.com/*"
   client -> http://DeleGateHost:8080/nytimes/

3) delegated -v -P8080
   client -> http://DeleGateHost:8080/-_-http://www.nytimes.com/

Cheers,
Yutaka
--
Yutaka Sato <ysato@etl.go.jp> http://www.etl.go.jp/~ysato/   @ @ 
Computer Science Division, Electrotechnical Laboratory      ( - )
1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan            _<   >_


*** ../../delegate5.9.1/src/httphead.c	Thu Mar 11 15:28:12 1999
--- ./httphead.c	Wed Mar 24 16:28:09 1999
***************
*** 612,617 ****
--- 612,622 ----
  	if( opath[0] == '/' )
  		strcpy(opath,opath+1);
  
+ 	if( DO_DELEGATE ){
+ 		sprintf(url,"%s://%s/-_-%s://%s/%s",
+ 			CLNT_PROTO,myhp,DST_PROTO,login,opath);
+ 		rewriteCookie(value,url);
+ 	}else
  	if( mount_url_fromL(url,DST_PROTO,login,opath,NULL,"http",myhp) )
  		rewriteCookie(value,url);
  }

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V