Dart Home | PowerTCP Web Enterprise for ActiveX | Custom Development | Reply | PowerTCP Web Enterprise for ActiveX Topics | Forums |
Author | Forum: PowerTCP Web Enterprise for ActiveX Topic: cookies with webasp |
Barbara Hamby From: Springfield, MO USA Posts: 11 Member Since: 10/04/02 |
posted November 25, 2002 12:56 PM I've been having problems getting the webasp control to format my cookies in a way that the server will accept. If I try to use the cookies.add method, I get a cookie that includes a "path=/" variable (which the apache server rejects). If I try to use the "Cookie: " header or httpCookie header, it doesn't get sent at all. I can send other headers just fine, just not "Cookie: ". I even tried making the cookie look the same as it does when I use cookies.add but it still doesn't send that header. I also tried it in a GET with the same results. The web tool was sending the cookies just fine, but I'd prefer to use webasp. Here's the code I'm using: Private Sub Command1_Click() Dim oCookie As New Cookie WebASP1.Trace "c:\trace.log", True, True, vbCrLf & "Send->" & vbCrLf, vbCrLf & "Recv<-" & vbCrLf WebASP1.Request.Url = "http://www.dart.com/PostSample.asp" oCookie.Name = "kid" oCookie.Value = "testing" WebASP1.Request.Cookies.Add oCookie ' neither of these alternates work! 'WebASP1.Request.Header.Add httpNull, "Cookie: " & oCookie.Name & "=" & oCookie.Value 'WebASP1.Request.Header.Add httpCookie, oCookie.Name & "=" & oCookie.Value WebASP1.Request.Body.Write "testing" WebASP1.Post End Sub Any help would be greatly appreciated. Thanks! |
K M Drake![]() From: Utica, NY USA Posts: 3406 Member Since: 07/14/00 |
posted November 26, 2002 12:17 PM Hi, We are looking at options for a future update. I suspect we will either stop removing Cookie headers added to the Header Collection (to give the option of not having the path included), or just stop adding the path automatically to the cookies. -ken |
Barbara Hamby From: Springfield, MO USA Posts: 11 Member Since: 10/04/02 |
posted December 2, 2002 11:11 AM I was looking back at RFC 2109, and it states that you should only send the path variable in the Cookie: header if the Set-Cookie: header contained a path variable. So maybe that would be the best solution. Not stripping cookie headers could work too - if you're concerned about a program accidentally duplicating the cookie headers, maybe you could only strip them if there are any cookies in the cookies collection? It's a little bit deceptive that one of the options in request.header.add is httpCookie and yet the control then strips it out. Here's the text from RFC2109: The value for the path attribute must be the value from the Path attribute, if any, of the corresponding Set-Cookie response header. Otherwise the attribute should be omitted from the Cookie request header. Thanks! |
Reply | PowerTCP Web Enterprise for ActiveX Topics | Forums |
This site is powered by
![]() |