Forum Moderators: open

Message Too Old, No Replies

Problem Converting Headers to Cookies

         

dhirschfeld

5:40 pm on Feb 16, 2003 (gmt 0)

10+ Year Member



I have developed a screenscraping application to catalog data from certain website. This works great except that now I have to get data from a site that requires me to first login via a login web page. I have no problem logging in to the page, but I can't figure out how to capture the authentication and pass it on to subsequent pages.

I am having a problem carrying forward the authentication to subsequent pages.

I tried NetworkCredentials but that didn't work.

Resp.Cookies.Count = 0 however, the Resp.Headers.Item.GetValue("set-cookies") displays the following: (UID and PW are ficticious)

CFID=31563; expires=Sun, 27-Sep-2037 00:00:00 GMT; path=/;,CFTOKEN=91427790; expires=Sun, 27-Sep-2037 00:00:00 GMT; path=/;,CID=44352; path=/; domain=.domain.com;,LOGIN=gina; path=/; domain=.domain.com;,MASK_CID=44352; path=/; domain=.domain.com;,MASK_LOGIN=gina; path=/; domain=.domain.com;,MASK_PASSWORD=%CD%B%D3%C1%D0%DC; path=/; domain=.domain.com;,MASK_STATUS=350; path=/; domain=.domain.com;,MASK_UID=44417; path=/; domain=.domain.com;,MASK_USERNAME=gina+Ganzman; path=/; domain=.domain.com;,PASSWORD=%C1%D3%D3%CD%D8%CD; path=/; domain=.domain.com;,PID=113094; expires=Sun, 27-Sep-2037 00:00:00 GMT; path=/; domain=.domain.com;,PRIV_MAINT=0; path=/; domain=.domain.com;,STATUS=350; path=/; domain=.domain.com;,UID=44417; expires=Tue, 18-Mar-2003 12:33:36 GMT; path=/; domain=.domain.com;,USERNAME=gina+Ganzman; path=/; domain=.domain.com;,ZORO=0; path=/; domain=.domain.com;

I don't know how to convert this data into a cookie and add it to the req.CookieContainer. When I try to directly add this data into req.headers.Add("set-cookie", <the above data> nothing happens.

Can someone please tell me what I'm doing wrong?

[edited by: Xoc at 10:14 am (utc) on Feb. 18, 2003]
[edit reason] removed specific domain [/edit]

jeremy goodrich

8:33 pm on Feb 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Gee, that seems pretty complex. :) I don't have any experience with this sort of thing though...perhaps another member could chime in to help you?

Or is the problem solved by now?