Home
> Uncategorized > Changing a Cookie’s path C#
Changing a Cookie’s path C#
When using a httpWebRequest to a page, with an attached Cookie container, you may find sometimes that the Cookie is set with the wrong path, for instance /cgi-bin/process.cgi rather than cgi-bin/ – This may make the cookie unreadable to other pages within that folder.
Fear not, the solution is simple
Dim cA As Cookie
Dim ccS As CookieCollection
ccS = RequestCookies.GetCookies(New Uri(http://www.someuri.com/cgi-bin/process.cgi"))
cA = ccS.Item(0)
cA.Path = "/cgi-bin"
RequestCookies.Add(cAuthID)
RequestCookies being a Cookie Container object.
Categories: Uncategorized
Comments (0)
Trackbacks (0)
Leave a comment
Trackback