Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How make Cookie container in android?

I found that in vb.net, in webclient inherits. is like this:
VB
* Private cookieCont As New Net.CookieContainer()

Private lastPage As String

Protected Overrides Function GetWebRequest(ByVal address As System.Uri) As System.Net.WebRequest
  Dim wr = MyBase.GetWebRequest(address)
  If TypeOf wr Is Net.HttpWebRequest Then
    With DirectCast(wr, Net.HttpWebRequest)

      * .CookieContainer = cookieCont

      If lastPage IsNot Nothing Then
        .Referer = lastPage
      End If
    End With
  End If
  lastPage = address.ToString()
  Return wr
End Function

Thanks!
Posted
Updated 21-Jul-14 6:01am
v2
Comments
TorstenH. 21-Jul-14 10:30am    
One simply buys a Android Coockie Jar[^]

Seariously: What do you want to achive by this?
Member 10839037 21-Jul-14 10:55am    
There is site who I need to send post and get xml, but it's not work, because the site check session. In short I need to build post who get cookies and set them back. In the result I need to get cookie value 1 and in the next +1...

In short I need to build post like the example who I showed in my question...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900