How Shit i Remove Cookies From My HttpWebRequest

06/20/2014 23:38 Eslam Galull#1
im trying To Delete The Cookie Which i Send To ImVu Website

I Cant Do it .. i used alot of codes i Get Bored !!

Website Work By Cookie to track You ..

i wanna Set Expire Data ( Nw ) Or Value or something Make Cookie Cant Trace Me .. Every Connection

Here is My Code



PHP Code:
 Dim postData As String = "POSTDATA=sauce=&avatarname=" & TargetAvatar & "&" & "password=" & thPw & "&password_strength=strong&sendto="
        
Dim tempCookies As New CookieContainer

        Dim encoding 
As New UTF8Encoding
        Dim byteData 
As Byte() = encoding.GetBytes(postData)


        
Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create(MainLoginPage), HttpWebRequest)
        
postReq.Method = "POST"
        
postReq.KeepAlive = True
        postReq
.CookieContainer = tempCookies
        postReq
.ContentType = "application/x-www-form-urlencoded"
        
postReq.Referer = ReferPage
        postReq
.UserAgent = TextBox1.Text

        
'postReq.KeepAlive = True
        ' 
postReq.AllowAutoRedirect = True


        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
        
'  postresponse.Close()

        Dim postreqreader As New StreamReader(postresponse.GetResponseStream())
        Dim thepage As String = postreqreader.ReadToEnd
        ' 
postreqreader.Close() 
06/21/2014 01:04 tolio#2
use a new cookiecontainer and the cookie is gone
06/21/2014 17:23 Eslam Galull#3
can you explain More ?! i Already Doing what you say

Here is my Full Code


PHP Code:
 Dim worker As System.ComponentModel.BackgroundWorker = CType(sender, System.ComponentModel.BackgroundWorker)
        
Dim postData As String = "POSTDATA=sauce=&avatarname=" & TargetAvatar & "&" & "password=" & thPw & "&password_strength=strong&sendto="
        
Dim tempCookies As New CookieContainer
        Dim logincookie 
As CookieContainer
        Dim encoding 
As New UTF8Encoding
        Dim byteData 
As Byte() = encoding.GetBytes(postData)


        
Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create(MainLoginPage), HttpWebRequest)
        
postReq.Method = "POST"
        
postReq.KeepAlive = True
        postReq
.CookieContainer = tempCookies
        postReq
.ContentType = "application/x-www-form-urlencoded"
        
postReq.Referer = ReferPage
        postReq
.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1"

        'postReq.KeepAlive = True
        ' 
postReq.AllowAutoRedirect = True

        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
        
'  postresponse.Close()


        Dim postreqreader As New StreamReader(postresponse.GetResponseStream())
        Dim thepage As String = postreqreader.ReadToEnd
        ' 
postreqreader.Close() 
06/27/2014 23:14 PC Jones#4
Quote:
Originally Posted by its.soul View Post
can you explain More ?! i Already Doing what you say

Here is my Full Code


PHP Code:
 Dim worker As System.ComponentModel.BackgroundWorker = CType(sender, System.ComponentModel.BackgroundWorker)
        
Dim postData As String = "POSTDATA=sauce=&avatarname=" & TargetAvatar & "&" & "password=" & thPw & "&password_strength=strong&sendto="
        
Dim tempCookies As New CookieContainer
        Dim logincookie 
As CookieContainer
        Dim encoding 
As New UTF8Encoding
        Dim byteData 
As Byte() = encoding.GetBytes(postData)


        
Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create(MainLoginPage), HttpWebRequest)
        
postReq.Method = "POST"
        
postReq.KeepAlive = True
        postReq
.CookieContainer = tempCookies
        postReq
.ContentType = "application/x-www-form-urlencoded"
        
postReq.Referer = ReferPage
        postReq
.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1"

        'postReq.KeepAlive = True
        ' 
postReq.AllowAutoRedirect = True

        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
        
'  postresponse.Close()


        Dim postreqreader As New StreamReader(postresponse.GetResponseStream())
        Dim thepage As String = postreqreader.ReadToEnd
        ' 
postreqreader.Close() 
Just:
tempCookies = new CookieContainer()
loginCookies = new CookieContainer()