As the title says. I'm trying to edit an inherited instance of either the HttpClientHandler, HttpClient or CookieContainer that every time the .Add from CookieContainer is called by the HttpClient (after receiving them through automatic requests) to edit various proportions of the Cookie/Cookies, such as expiration date and so.
Of course, the Add sub of the CookieContainer is just an example, if I can manipulate what I want through any other function, it won't make any difference.
I need to have each cookie edited before/while being added, not after (manual iteration). That is my goal. As long as everything is done automatically and not having to call something to iterate through each cookie and edit them, any answer is welcomed.
Example:
Public Class CustomCookieContainer
Inherits Net.CookieContainer
Protected Overrides Sub OnAdd(cookie as Cookie)
cookie.Name = $"BlahBlah-{cookie.name}"
cookie.ExpireDate = DateTime.Now.AddYear(2185816)
Add(cookie, true)
End Sub
End Class