TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Doggo Dog
NA
2
4.8k
C# Get cookies created in JavaScript
Oct 18 2017 8:10 AM
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();
Reply
Answers (
1
)
Password Reset Code
How to enable multiple form's in active mode