Results 1 to 2 of 2

Thread: [02/03] removing cookie in CookieCollection

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    [02/03] removing cookie in CookieCollection

    Using VS 2002;
    With HttpWebRequest and HttpWebResponse I am able to get our site cookie info but I need to change one of the values.

    Example say I have the following in the CookieCollection:
    ABCD=1234566
    JSESSIONID=8F87B2D0C39615DF8053B992ABE6D13F
    GBBLogon=

    I want to remove GBBLogon and then change the JSESSIONID. I only see .Add and a .Copy. Can you not delete and then add?

    Anyone have any code to manually create a cookiecollection?
    Thanks

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    Re: [02/03] removing cookie in CookieCollection

    Just wanted to post my code that I can read the cookie.

    Was thinking that cookies could only be written by the source computer. So if I am able to figure out how to modify the cookie will the page I am posting to not accept the cookie if not the original source?


    VB Code:
    1. Private Function ParseCookie(ByVal ccCookieCol As CookieCollection, ByVal sURL As String) As String
    2.         Dim sTemp1 As String
    3.         Dim iLoop As Integer
    4.         Dim iCookieCount As Integer
    5.  
    6.         iCookieCount = ccCookieCol.Count
    7.         If iCookieCount > 0 Then
    8.             For iLoop = 0 To iCookieCount - 1
    9.                 If iLoop = 0 Then
    10.                     sTemp1 &= ccCookieCol(iLoop).ToString
    11.                 Else
    12.                     sTemp1 &= ";" & ccCookieCol(iLoop).ToString
    13.                 End If
    14.             Next
    15.             txtCookie.Text = sTemp1
    16.         End If
    17.     End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width