473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to get and pass cookies.

Kevinyy
77
I'm working on a proxy and i was wondering how i can collect the cookies and pass them back to the client? so they can log into sites and etc? here is my http receive code and pass the info back:
Expand|Select|Wrap|Line Numbers
  1. System.Net.Configuration.HttpWebRequestElement wr = new System.Net.Configuration.HttpWebRequestElement();
  2. wr.UseUnsafeHeaderParsing = true;
  3. HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
  4. CookieContainer cookieContainer = new CookieContainer();
  5. request.CookieContainer = cookieContainer;
  6. request.CookieContainer.Add(cookieContainer.GetCookies((Uri)url));
  7. HttpWebResponse response = (HttpWebResponse)request.GetResponse();
  8. Stream responsestream = response.GetResponseStream();
  9. byte[] buffer = new byte[bz];
  10. rebu = responsestream.Read(buffer, 0, bz);
  11. while (rebu != 0)
  12. {
  13.     soket.Send(buffer, rebu, 0);
  14.     rebu = responsestream.Read(buffer, 0, bz);
  15. }
  16.  
how can i gather the cookies and pass them back?
-Thanks

C#.Net3.5
Oct 8 '08 #1
3 1907
Kevinyy
77
Can anyone help? I have not yet resolved this problem
Oct 10 '08 #2
Frinavale
9,735 Expert Mod 8TB
You can use the Request.Cookies collection to retrieve cookies.

As for passing them along......I'm not sure what you're trying to do.

-Frinny
Oct 10 '08 #3
Kevinyy
77
You can use the Request.Cookies collection to retrieve cookies.

As for passing them along......I'm not sure what you're trying to do.

-Frinny
im writing a cookie compliant proxy.
Oct 11 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Carl | last post by:
Hi, I want to pass the value of the cookie created in VB to ASP. This doesn't work. Any idea? Thanks Carl .... <script language=vbscript> document.cookie="mycookie" '...
4
by: Fred | last post by:
Hi, i know how to pass a value from Javascript to ASP with a hidden field into a form and submitting it, or with cookies, but here i have to pass a lot of data in an array. There is a list of...
7
by: Andy Fish | last post by:
Hi, I have a javascript solution where page A launches page B in a second window and then they can pass data between them. That's all well and good. Now say page B wants to navigate to page C...
3
by: Naseem | last post by:
I am using CR in ASP.NET , I am able to show drill down graphs where grouping is done on single column from result set of sql query, is it possible to achieve drill down by grouping on multiple...
17
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the...
6
by: taylor.ettema | last post by:
I wish to create an application that will be spawned within a host web application after the container app has authorized a user. These two apps are seperately developed/maintained, and can only...
3
by: JDS | last post by:
So, I'd like to create the following scenario: 1) Use cURL library within PHP (cURL + "Cookie Jar", et.al) to create a virtual browser session that "logs in" to a remote site. (For example: ...
5
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, Is there an easier way to handle that? I used Javascript to handle this when our two domains are hosted on two different servers(on different networks) and our search engine marketing...
2
by: =?Utf-8?B?U3RldmVuIFRhbmc=?= | last post by:
I'm creating a XBAP application and want it take some input from webpage dynamically? what is the best way? how to do it? Best Regards Steven -- ======================= Steven Tang SYWWUYU)
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.