Public Function GetSessionVar(ByVal pASPSessionVar As String) As String
        Dim pASPCookieName As String
        Dim pASPCookieValue As String
        If Not GetSessionCookie(pASPCookieName, pASPCookieValue) Then
            Return ""
        End If
        Dim pMyRequest As HttpWebRequest = CType(WebRequest.Create(mASPSessionVarASP + "?SessionVar=" + pASPSessionVar), HttpWebRequest)
        pMyRequest.Headers.Add("Cookie: " + pASPCookieName + "=" + pASPCookieValue)
        'pMyRequest.RequestUri()
        'pMyRequest.Timeout = 10000
        'pMyRequest.KeepAlive = False
        'pMyRequest.Method = "POST"
        Dim pMyResponse As HttpWebResponse = CType(pMyRequest.GetResponse(), HttpWebResponse)
        Dim pReceiveStream As Stream = pMyResponse.GetResponseStream()
        Dim pReadStream As StreamReader = New StreamReader(pReceiveStream, System.Text.Encoding.UTF8)
        Dim pStrResponse As String = pReadStream.ReadToEnd()
        pReadStream.Close()
        pMyResponse.Close()
        Return pStrResponse
    End Function
    Private Function GetSessionCookie(ByRef pASPCookieName As String, ByRef pASPCookieVal As String) As Boolean
        Dim pIntCnt As Integer
        Dim pMyCookie As HttpCookie
        pASPCookieName = ""
        pASPCookieVal = ""
        Dim pCookieArray As String() = mOcontext.Request.Cookies.AllKeys
        For pIntCnt = 0 To pCookieArray.Length - 1
            pMyCookie = mOcontext.Request.Cookies(pCookieArray.GetValue(pIntCnt))
            If pMyCookie.Name.StartsWith("ASPSESSION") Then
                pASPCookieName = pMyCookie.Name
                pASPCookieVal = pMyCookie.Value
                Return True
            End If
        Next
        Return False
    End Function

Like it on Facebook, Tweet it or share this article on other bookmarking websites.

Comments (0)

There are no comments posted here yet

High-handedness of government

The government is foolish to fight the Army chief and the scientists

No answer selected. Please try again.
Please select either existing option or enter your own, however not both.
Please select minimum 0 answer(s) and maximum 4 answer(s).
/polls/politics/6228-high-handedness-of-government.json?task=poll.vote
6228
radio
[{"id":"21475","title":"No, the government is following rules","votes":"21","type":"x","order":"0","pct":29.58,"resources":[]},{"id":"21476","title":"The government should have magnanimously agreed to Army chief's and the scientist's arguments","votes":"25","type":"x","order":"0","pct":35.21,"resources":[]},{"id":"21477","title":"Government is always blind and deaf","votes":"15","type":"x","order":"0","pct":21.13,"resources":[]},{"id":"21478","title":"This government is so arrogant","votes":"10","type":"x","order":"0","pct":14.08,"resources":[]}] ["#ff5b00","#4ac0f2","#b80028","#eef66c","#60bb22","#b96a9a","#62c2cc"] ["rgba(255,91,0,0.7)","rgba(74,192,242,0.7)","rgba(184,0,40,0.7)","rgba(238,246,108,0.7)","rgba(96,187,34,0.7)","rgba(185,106,154,0.7)","rgba(98,194,204,0.7)"] 350
bottom 200
No married couple wants to end up getting divorced. It is not like they have planned for it. They try to put up with their partners for as long as they
Due to our modern lifestyle, we feel that digestion related disorders are a common problem. Thus, we neither give importance to them nor seek any help
The bond of marriage brings the two people together. Initially, everything may seem okay and both of them slowly start discovering each other in the journey.
Your online reputation is important You should know that it takes decades to make your reputation but to ruin it you need just couple of minutes and this
Basics of Cookies is Asp.Net Through this article you are able to know about the following points:1> What are the cookies?2> How to write and read cookies
  Introduction A Web server hosts information in the form of HTML files. The Web server is usually passive and merely acts as an efficient interface
Best language to learn .NET language is the best thing to learn. It has somewhat similar syntax as java and it’s a Microsoft Technology moreover it
If you decide to have an  opt-in list is not just a matter of sending your subscribers your promotional newsletters or catalogs. There are several things