Archived Forum Post

Index of archived forum posts


Use different cookies at the same time?

Nov 04 '13 at 12:32


Am I right if I want to use 2 different instances of Chilkat.Http I have to define 2 different pathes for cookies? So if I have 2 proxies and I want to login on one webserver with 2 different login details I don't want to share the cookies. So I have to do something like this?

        Http http = new Http();
        // Cookies
        string path = Path.Combine("Cookies", string.Join("_", Proxy.Address, Proxy.Port));
        if (!Directory.Exists(path))
        http.CookieDir = path;
        http.SendCookies = true;
        http.SaveCookies = true;


Accepted Answer

If using "memory" instead of a file (meaning that the CookieDir property is set to the keyword "memory" so that an in-memory cache is used), then each CkHttp object has it's own in-memory cache of cookies that is only in existence while the CkHttp object exists.


Yes, if you want cookies persisted to a file, and you don't want them shared between different instances of Chilkat.Http objects, then you would use separate files.


No, its not necessary to save them to a file.

Ah okay, am I right, that memory is not sharing cookies between instances?


That's what I need, thank you :)