Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
C# Get cookies created in JavaScript
Doggo Dog
Oct 18 2017 8:10 AM
240
Reply
So I stumbled on this problem while creating a application that get's cookies from a website. For some reason the program only outputs a few cookies instead of every single one, somebody told me it might be because some cookies are created with JavaScript. Is it possible making this still in C#,
Thanks.
string url = textBox1.Text;
var cookies =
new
CookieContainer();
HttpWebRequest myCall = (HttpWebRequest)WebRequest.Create(url);
myCall.CookieContainer = cookies;
HttpWebResponse response = (HttpWebResponse)myCall.GetResponse();
myCall.AllowAutoRedirect =
true
;
myCall = (HttpWebRequest)WebRequest.Create(url);
myCall.CookieContainer = cookies;
foreach (Cookie cookie in response.Cookies)
{
Console.WriteLine(cookie.Name);
Console.Read();
}
myCall.Abort();
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Password Reset Code
How to enable multiple form's in active mode