c# - HttpWebRequest cookie for redirected request -


or should authorize me on site in my program, authorization request on the cookie value and pages (page 1, Mysite. com / lots / 8188 / request / 4261 / "), which I redirect to another (page 2, which url eg" mysite.com/lots/view/8188/ "):

 < code> SendingRequest.CookieContainer = new Cookie Contaneyr (); SendingRequest.CookieContainer.Add (sending request. requests, new cookies (ASPNETSessionIdCookieName, this.ASPNETSessionIdCookie)); request. Anumodnotoardiarekt = true; SendingRequest.Maximu mAutomaticRedirections = 100; HttpWebResponse response = (HttpWebResponse) sendingRequest.GetResponse ();   

Well, Page 1 and I was sent back to the page required HTTP with the required URL 2 2 Page 3 I have, then going to send the requested page 2, but it ASPNETSessionIdCookieName does not send cookies to page 2 and server gives me inept response. to redirect requests how do I use "ASPNETSessionIdCookieName"?

Auto-Reedairesitn is going cookies changing domain / URL that changed once URL, URI To check, the URI believes that this problem is the first parameter of CookieContainer.Add .

You are banning cookies on the first page URL.

Try the change for something like this:

  sending. Request cookie. Container.ad (new cookie (ASPNETIDKKName, this.aspnatsididcookie));   

If you want to restrict that domain to cookies only, then you can use the cookie four parameter builder.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -