Hello everyone.
So I've been working on an small tool, that is using httpwebrequests, its not a bad so far I've got login function and list view loading data from site.
But problem is now cookie container so i can do other things than just loading, like editing data.
Uri is subdomain so no www. in it also its https.
When i try to use:

CookieContainer cookies = new CookieContainer();
request.CookieContainer = cookies;

Nothing actually happens, container is still empty? So i cant reuse cookie on new function.. Any ideas?

Thank you for your time and help!

Recommended Answers

All 5 Replies

It does count 0, otherwise i wouldn't post this here...

And the code agrees it should be zero. I take it there's more code but I respect your need to keep it under wraps.

Code is pretty big, problem is that everything works well except cookies, cookies are not saved into container as they should.
I've found on google that cookiecontainer has bug working on subdomains so it doesnt save automatically cookies, thats why i posted here asking about solutions if someone has one?

Have you tried stripped down code using only webrequest with the cookiecontainer on a regular domain, so you know it works? Or does it always fail, on any domain?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.