Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8780859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:09:36+00:00 2026-06-13T20:09:36+00:00

After my question Can't login with HttpWebRequests , I successfully logged in. I get

  • 0

After my question Can't login with HttpWebRequests, I successfully logged in. I get the page where it says “Thank you for logging in”, but after that I don’t seem to be logged in.

To me this looks like a cookie problem. In firebug the cookies appeared to be HttpOnly could that be a problem? How can I make the HttpWebRequest use cookies?

Here’s the code I use to login:

string url = "http://www.warriorforum.com/login.php?do=login";

var bytes = Encoding.Default.GetBytes(@"vb_login_username=USERNAME&cookieuser=1&vb_login_password=&s=&securitytoken=guest&do=login&vb_login_md5password=d9350bad28eee253951d7c5211e50179&vb_login_md5password_utf=d9350bad28eee253951d7c5211e50179");
var container = new CookieContainer();

var request = (HttpWebRequest)(WebRequest.Create(url));
request.CookieContainer = container;
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)";
request.ContentLength = bytes.Length;
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.KeepAlive = true;
request.AllowAutoRedirect = true;
request.AllowWriteStreamBuffering = true;
request.CookieContainer = container;
using (var requestStream = request.GetRequestStream())
    requestStream.Write(bytes, 0, bytes.Length);

var requestResponse = request.GetResponse();
using (var responsStream = requestResponse.GetResponseStream())
    if (responsStream != null)
    {
        using (var responseReader = new StreamReader(responsStream))
        {
            var responseStreamReader = responseReader.ReadToEnd();
            richTextBox1.Text = responseStreamReader; //this is to read the page source after the request
      }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:09:37+00:00Added an answer on June 13, 2026 at 8:09 pm

    The HttpWebRequest.CookieContainer‘s manual page says:

    The CookieContainer property provides an instance of the CookieContainer class that contains the cookies associated with this request.

    You do:

    var container = new CookieContainer();
    

    So on every request, you begin with a new CookieContainer without any cookies. Make container a class member and only instantiate it once.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think this is a pretty basic question, but after Googling around I can't
with a HTTP request I'm login into the page: https://secure.bodytel.com/de/mybodytel.html . After that I
Im writing a facebook-connect app that login user after authenticate session on facebook, question
I know that similar question was asked several times, but still I can't make
My question is how can i clear the editText field after i have saved
I want to create a login page, it can easy implement using Ruby on
Question. How can i get started with flash/flex or actionscript, to use the Skype4Com,
Seems like a beginner question but I can't seem to figure it out ...
I'm using Zend_Auth to store session values after login. My question is: let's say
I have a form that i am trying to submit after the page loads

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.