I have a java application running like a server in Tomcat for my web app and my app cordova (same as the web application but with functions like a BarCode Scanner). With this application the server works perfectly. But now I am developing a little part of the aplication in VB.NET with compact framework 3.5 and when I log in the server store my session variable... Ok, that's fine but if I make a new request, my server detects a new session and for this my session variable is not here and for each request is opening a new Http Session. I think the problem is in VB. That's my code where I open requests to my server
Try
Dim url = "http://192.168.2.166:8084/SCTraker_Servidor/api/Session"
Dim httpWebRequest As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest)
httpWebRequest.Method = "POST"
httpWebRequest.ContentLength = byteArray.Length
httpWebRequest.ContentType = "application/json"
Dim dataStream = httpWebRequest.GetRequestStream()
dataStream.Write(byteArray, 0, byteArray.Length)
dataStream.Close()
Dim httpWebResponse As HttpWebResponse
httpWebResponse = DirectCast(httpWebRequest.GetResponse, HttpWebResponse)
If httpWebResponse.StatusCode = 200 Then
Me.Hide()
httpWebRequest.Abort()
httpWebResponse.Close()
Home.Show()
Else
BarraEstado.Text = "No ha rellenado el campo usuario o contraseƱa"
End If
Catch webException As WebException
BarraEstado.Text = webException.Message
Dim respuesta = webException.Response
Catch socketException As Sockets.SocketException
BarraEstado.Text = socketException.Message
End Try