B4J Question vb.net and jserver session variables


Active Member
Licensed User
Hello all,

is it possible to have session variables stored when the client application is written in vb.net.
I would like Jserver to maintain the same session ( with user id variable ) every time the client connects.
With B4A and Jserver this was not an issue, works perfectly

thank you


Active Member
Licensed User
@Enrique Gonzalez R Thank you for pointing me in the right direction.
I get the cookie from the response headers, and set it when i send the request

code below. if anyone would like to use this

            Dim responseheaders As String
            responseheaders = request.GetResponse.Headers.ToString
            Dim responsecookiearr() As String
            If responseheaders <> "" Then
                If responseheaders.Contains(vbCrLf) Then
                    responsecookiearr = responseheaders.Split(vbCrLf)
                    For Each respc As String In responsecookiearr
                        '  Console.WriteLine("Resp1 " & respc)
                        If respc.ToLower.Contains("set-cookie:") Then
                            responsecookie = respc.Replace(vbCrLf, "").Replace(vbLf, "").Replace("Set-Cookie: ", "")
                        End If

                End If

            End If

Update : Easier way to get response cookies in vb.net

 Dim responsecookie1 As String = request.GetResponse.Headers("Set-Cookie")
Last edited:
Upvote 0