Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I can get my httpwebrequest and httpwebresponse to work find for most sites but have stumbled accross a site that the cookies give me an error when it called that ccContainer.SetCookies below.

 

If I output the cookie before it tried to call .SetCookies I get the following:

JSESSIONID=0000HDtYsaUnQ3FipFBXEDq2V5F:-1;Path=/

storenameid=xxxxx;Domain=www.storenamedomain.com;Expires=Wed, 03-May-2006 07:07:46 GMT;Path=/

storenametypes=DOC~RAT;Domain=www.storenamedomain.com;Expires=Wed, 03-May-2006 07:07:46 GMT;Path=/

storenameuserinfo=REALNAME>FIRSTNAME LASTLAST~COMPANYNAME>ACTUAL COMPANY NAME HERE;Domain=www.storenamedomain.com;Expires=Wed, 03-May-2006 07:07:46 GMT;Path=/

 

I believe it has something to do with either the ';' or the , in the Expires section of each line.

 

Has anyone encountered this before?

 

.....
           m_hwrResponse = DirectCast(m_hwrRequest.GetResponse(), HttpWebResponse)

           srReader = New StreamReader(m_hwrResponse.GetResponseStream())
           sReturn = srReader.ReadToEnd()
           srReader.Close()


           If Not m_hwrResponse.Headers("Set-Cookie") Is Nothing Then
               txtOutput.Text = m_hwrResponse.Headers("Set-Cookie").ToString
               Dim ccContainer As New CookieContainer()

               ccContainer = New CookieContainer()
               ccContainer.SetCookies(m_hwrResponse.ResponseUri, m_hwrResponse.Headers("Set-Cookie"))
        m_ccCookies.Add(ccContainer.GetCookies(m_hwrResponse.ResponseUri))
           End If

           Me.Referer = m_hwrResponse.ResponseUri.AbsoluteUri
....

 

The returned err.Messege is:

An error has occured when parsing Cookie header for Uri 'url is provided'

 

Any thoughts?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...