Hi,<BR><BR>I am using Forms authentication. My logon page is login.aspx and resources.aspx is the protected page in the web.config. <BR><BR>According to this article <BR><BR>http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=340746<BR><BR>it should return the protected page if the domains match in c.Domain and the WebRequest.Create method in the code below:<BR><BR>Can anyone explain why I am getting the logon page? Maybe the statements are out of order or I am missing some code that was not shown in the previous link? <BR><BR><BR>I am running the following code: <BR><BR> Dim myWebReq As HttpWebRequest<BR> Dim myWebResp As HttpWebResponse<BR> Dim strHTML As String<BR> Dim c As New Cookie<BR> Dim sr As StreamReader<BR> Dim sw As StreamWriter<BR> Dim cc As New CookieContainer<BR><BR> myWebReq = WebRequest.Create("http://localhost/test/resources.aspx")<BR> c.Name = FormsAuthentication.GetAuthCookie(User.Identity.Na me, False).Name<BR> c.Value = FormsAuthentication.GetAuthCookie(User.Identity.Na me, False).Value<BR> c.Domain = "http://localhost/test"<BR> cc.Add(c)<BR> myWebReq.CookieContainer = cc<BR> myWebResp = myWebReq.GetResponse<BR> Trace.Write("forms cookie name is = " & c.Name.ToString)<BR> Trace.Write("forms cookie value is = " & c.Value.ToString)<BR> sr = New StreamReader(myWebResp.GetResponseStream)<BR> strHTML = sr.ReadToEnd<BR> sw = File.CreateText("g:DataLogs3.htm")<BR> sw.WriteLine(strHTML)<BR> sw.Close()<BR> Response.WriteFile("g:DataLogs3.htm") &#039; shows the logon page!!!!<BR><BR>trace.write shows the following:<BR><BR>aspx.page Begin Init <BR>aspx.page End Init 0.000244 0.000244 <BR><BR> forms cookie name is = AspNetWebAuth 5.882936 5.882692 <BR> forms cookie value is = C19249BB4B64B90A884D9D3B7C5435B6D50B57F82711D7CBEC 8B9646BEE14AF1A3F3CC3345DCB25878F46E3829E1BAA97DE5 A5BF456A1380 5.883073 0.000138 <BR><BR>aspx.page Begin PreRender 5.890319 0.007246 <BR>aspx.page End PreRender 5.890494 0.000174 <BR>aspx.page Begin SaveViewState 5.890861 0.000367 <BR>aspx.page End SaveViewState 5.891589 0.000728 <BR>aspx.page Begin Render 5.891637 0.000048 <BR>aspx.page End Render <BR><BR>anyone??? <BR><BR><BR>thanks<BR>vc <BR>