daydie 12 Junior Poster in Training

Here is my HTTP cookie request which auto loads browser after doing the cookie stuff. But it does not login and i dont know why =/

Dim logincookie As CookieContainer

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Dim postData As String = "referer=http%3A%2F%2Fforum.ea.com%2Fuk%2Fcategories%2Flist.page&selectprofile=true&remoteurl=http%3A%2F%2Fforum.ea.com%2Fuk%2FgusUser%2Flogin.page&action=Login&registrationSource=&authenticationSource=EA-JForums&HIDE_GUS=&username=" & TextBox1.Text & " &password=" & TextBox2.Text & ""
        Dim tempCookies As New CookieContainer
        Dim encoding As New UTF8Encoding
        Dim byteData As Byte() = encoding.GetBytes(postData)

        Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create("https://profile.ea.com/login.do?authenticationSource=EA-JForums&surl=http://forum.ea.com/uk/categories/list.page&remoteurl=http://forum.ea.com/uk/gusUser/login.page&selectprofile=true&locale=en_GB"), HttpWebRequest)
        postReq.Method = "POST"
        postReq.AllowAutoRedirect = True
        postReq.KeepAlive = True
        postReq.CookieContainer = tempCookies
        postReq.ContentType = "application/x-www-form-urlencoded"
        postReq.Referer = "https://profile.ea.com/login.do?authenticationSource=EA-JForums&surl=http://forum.ea.com/uk/categories/list.page&remoteurl=http://forum.ea.com/uk/gusUser/login.page&selectprofile=true&locale=en_GB"
        postReq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)"
        postReq.ContentLength = byteData.Length

        Dim postreqstream As Stream = postReq.GetRequestStream()
        postreqstream.Write(byteData, 0, byteData.Length)
        postreqstream.Close()
        Dim postresponse As HttpWebResponse

        postresponse = DirectCast(postReq.GetResponse(), HttpWebResponse)
        tempCookies.Add(postresponse.Cookies)
        logincookie = tempCookies
        Dim postreqreader As New StreamReader(postresponse.GetResponseStream())

        Dim thepage As String = postreqreader.ReadToEnd

        WebBrowser1.DocumentText = thepage

    End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.