Problem carrying authentication forward to other pages after login
From: David Hirschfeld (dhirschfeld@cox.net)
Date: 02/18/03
- Next message: Yama: "Changing the IhttpHandler"
- Previous message: Kevin Burton: "Programmatically creating a user account."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "David Hirschfeld" <dhirschfeld@cox.net> Date: Tue, 18 Feb 2003 08:26:01 -0800
Using VB.Net
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.
HTTPWebResponse.Cookies.Count = 0 however, the
HTTPWebResponse.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+hansen; 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 HTTPWebrequest.CookieContainer. When I try
to directly add this data into HTTPWebrequest.headers.Add
("set-cookie", <the above data>...) nothing happens.
Can someone please tell me what I'm doing wrong?
- Next message: Yama: "Changing the IhttpHandler"
- Previous message: Kevin Burton: "Programmatically creating a user account."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|